diff --git a/Xresources b/Xresources index c56b681..fac8685 100644 --- a/Xresources +++ b/Xresources @@ -40,7 +40,7 @@ URxvt*background: black URxvt*transparent: true -URxvt*shading: 40 +URxvt*shading: 10 Xft.antialias: true Xft.hinting: true diff --git a/config/i3/config b/config/i3/config index 112e1cf..2f6bb90 100644 --- a/config/i3/config +++ b/config/i3/config @@ -53,14 +53,14 @@ default_floating_border none # class border backgr. text indicator child_border client.focused #ffffff #888888 #000000 #ffffff #888888 client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a -client.unfocused #ff0000 #040404 #888888 #444444 #444444 -client.urgent #2f343a #900000 #ffffff #900000 #900000 +client.unfocused #a000ff #040404 #888888 #444444 #444444 +client.urgent #2f343a #600099 #ffffff #600099 #600099 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #000000 # Use pactl to adjust volume in PulseAudio. -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +7% +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +8% bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -7% bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle @@ -87,9 +87,11 @@ bindsym $mod+w kill #bindsym $mod+r exec dmenu_run bindsym $mod+r exec --no-startup-id ~/.config/rofi/bin/menu_powermenu # start rofi -bindsym $mod+p exec rofi -show run +bindsym $mod+p exec "rofi -modes combi -show combi run,window" # switch rofi bindsym $mod+q exec rofi -show window +# rofi fb +bindsym $mod+g exec rofi -show file-browser-extended # ssh rofi #bindsym $mod+c exec rofi -show ssh bindsym $mod+c exec --no-startup-id ~/.config/rofi/bin/menu_time @@ -244,34 +246,34 @@ bindsym $mod+Shift+c reload bindsym $mod+Shift+r restart # exit i3 (logs you out of your X session) bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" +# + #resize window (you can also use the mouse for that) + mode "resize" { + # These bindings trigger as soon as you enter the resize mode -# resize window (you can also use the mouse for that) -# mode "resize" { -# # These bindings trigger as soon as you enter the resize mode -# -# # Pressing left will shrink the window’s width. -# # Pressing right will grow the window’s width. -# # Pressing up will shrink the window’s height. -# # Pressing down will grow the window’s height. -# bindsym j resize shrink width 10 px or 10 ppt -# bindsym k resize grow height 10 px or 10 ppt -# bindsym l resize shrink height 10 px or 10 ppt -# bindsym semicolon resize grow width 10 px or 10 ppt -# -# # same bindings, but for the arrow keys -# bindsym Left resize shrink width 10 px or 10 ppt -# bindsym Down resize grow height 10 px or 10 ppt -# bindsym Up resize shrink height 10 px or 10 ppt -# bindsym Right resize grow width 10 px or 10 ppt -# -# # back to normal: Enter or Escape or $mod+r -# bindsym Return mode "default" -# bindsym Escape mode "default" -# bindsym $mod+r mode "default" -# } + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" + } +# # Supposed to kill with center button -bindsym --release button2 kill +bindsym --release button2 killa # Custom config window for_window [class="vlc"] floating enable @@ -285,7 +287,7 @@ assign [class="Telegram"] 9 assign [class="Mailspring"] 7 assign [class="MineTime"] 7 -# bindsym $mod+r mode "resize" +#bindsym $mod+Return mode "resize" # Workspace config workspace 1 output eDP1 @@ -313,21 +315,21 @@ bar { colors { background #000000 - statusline #ffffff + statusline #a000ff separator #aaaaaa # Default conf # focused_workspace #4c7899 #285577 #ffffff focused_workspace #ffffff #888888 #000000 active_workspace #888888 #444444 #ffffff - inactive_workspace #888888 #444444 #ff0000 - urgent_workspace #2f343a #900000 #ffffff - binding_mode #2f343a #900000 #ffffff + inactive_workspace #888888 #000000 #a000ff + urgent_workspace #2f343a #600099 #ffffff + binding_mode #2f343a #600099 #ffffff } - # separator_symbol "ʃ" + separator_symbol "ʃ" #separator_symbol "❰" - separator_symbol " ❱ " + #separator_symbol "❱" #separator_symbol " ▷ " #separator_symbol " ∠ " #separator_symbol "|" diff --git a/config/i3/i3status.conf b/config/i3/i3status.conf index c073950..a7c438d 100644 --- a/config/i3/i3status.conf +++ b/config/i3/i3status.conf @@ -4,7 +4,7 @@ order += keyboard_layout order += arch_updates order += "whatismyip" order += spotify -order += "ipv6" +# order += "ipv6" order += "wireless _first_" order += "ethernet _first_" order += net_rate @@ -22,6 +22,7 @@ spotify { button_next = 4 button_play_pause = 3 button_previous = 5 + format_down = "" } whatismyip { @@ -33,6 +34,9 @@ whatismyip { battery all { format = "%status %percentage %consumption" + low_threshold = 30 + threshold_type = percentage + last_full_capacity = true } wireless _first_ { diff --git a/config/keepassxc/keepassxc.ini b/config/keepassxc/keepassxc.ini index 505e714..479df0e 100644 --- a/config/keepassxc/keepassxc.ini +++ b/config/keepassxc/keepassxc.ini @@ -5,19 +5,20 @@ ConfigVersion=2 CustomProxyLocation= Enabled=true +[FdoSecrets] +Enabled=false + [GUI] ApplicationTheme=dark TrayIconAppearance=monochrome-light -[KeeShare] -Active="\n\n \n\n" -Foreign="\n\n \n\n" -Own="\n\n \n \n\n" -QuietSuccess=true - [PasswordGenerator] AdditionalChars= ExcludedChars= +Length=32 + +[SSHAgent] +Enabled=false [Security] LockDatabaseScreenLock=false diff --git a/config/nvim/lua b/config/nvim/lua new file mode 120000 index 0000000..1e3057c --- /dev/null +++ b/config/nvim/lua @@ -0,0 +1 @@ +/home/legrems/Documents/dotfiles/nvim/lua \ No newline at end of file diff --git a/gitconfig b/gitconfig index 7873cd3..29dfd4b 100644 --- a/gitconfig +++ b/gitconfig @@ -2,8 +2,9 @@ email = loic.gremaud@arcanite.ch name = Loïc Gremaud ;signingkey = 8B2741BF148B1059065A71EEE81E8B180465D116 ;540 - signingkey = BAE2CD06F0A3753A0F8D0A21D4620E6DF3E0121D ;539 + ;signingkey = BAE2CD06F0A3753A0F8D0A21D4620E6DF3E0121D ;539 ;signingkey = 4F78275C96E34F56920CF7B5CACB2A128E557EFD ;W + signingkey = C6424C524F8B4D0B0C6F9380ACD9F65FA7E19986;USB-C token = REPLACE HERE TOKEN [commit] gpgSign = true diff --git a/gitignore_global b/gitignore_global index b39f5e7..7899d63 100644 --- a/gitignore_global +++ b/gitignore_global @@ -1,2 +1,3 @@ .autoenv.zsh .autoenv_leave.zsh +tags diff --git a/nvim/lua/telescope/custom.lua b/nvim/lua/telescope/custom.lua new file mode 100644 index 0000000..633ac21 --- /dev/null +++ b/nvim/lua/telescope/custom.lua @@ -0,0 +1,99 @@ +local actions = require("telescope.actions") + +local action_state = require "telescope.actions.state" + +local interactive_rebase = function(prompt_bufnr) + local selection = action_state.get_selected_entry() + -- Use vim-fugitive for the rebase + vim.cmd('Git rebase -i ' .. selection.name) +end + +require("telescope").setup{ + extensions = { + coc = { + theme = 'ivy', + prefer_locations = true, -- always use Telescope locations to preview definitions/declarations/implementations etc + } + }, + defaults = { + mappings = { + i = { + [""] = actions.close, + [""] = false + }, + }, + theme = "ivy", + }, + pickers = { + git_branches = { + mappings = { + i = { + [""] = interactive_rebase + }, + }, + }, + }, +} + +-- Implement delta as previewer for diffs + +local previewers = require('telescope.previewers') +local builtin = require('telescope.builtin') +local conf = require('telescope.config') +local E = {} + +local delta = previewers.new_termopen_previewer { + get_command = function(entry) + -- this is for status + -- You can get the AM things in entry.status. So we are displaying file if entry.status == '??' or 'A ' + -- just do an if and return a different command + if entry.status == '??' or 'A ' then + return { 'git', '-c', 'core.pager=delta', '-c', 'delta.side-by-side=false', 'diff', entry.value } + end + + -- note we can't use pipes + -- this command is for git_commits and git_bcommits + return { 'git', '-c', 'core.pager=delta', '-c', 'delta.side-by-side=false', 'diff', entry.value .. '^!' } + + end +} + +E.my_git_commits = function(opts) + opts = opts or {} + opts.previewer = delta + + builtin.git_commits(opts) +end + +E.my_git_bcommits = function(opts) + opts = opts or {} + opts.previewer = delta + + builtin.git_bcommits(opts) +end + +E.my_git_status = function(opts) + opts = opts or {} + opts.previewer = delta + + builtin.git_status(opts) +end + +E.my_git_branches = function(opts) + opts = opts or {} + opts.previewer = delta + + builtin.git_branches(opts) +end + +E.project_files = function() + local opts = {} -- define here if you want to define something + vim.fn.system('git rev-parse --is-inside-work-tree') + if vim.v.shell_error == 0 then + require"telescope.builtin".git_files(opts) + else + require"telescope.builtin".find_files(opts) + end +end + +return E diff --git a/p53_screen.sh b/p53_screen.sh index f2707e0..9742596 100755 --- a/p53_screen.sh +++ b/p53_screen.sh @@ -1,7 +1,7 @@ -xrandr --output eDP-1 --auto +xrandr --output eDP1 --auto xrandr --output DP-1-0.2 --off xrandr --output DP-1-0.3 --off sleep 2 -xrandr --output eDP-1 --scale 0.5x0.5 +xrandr --output eDP1 --mode 2560x1440 --scale 1x1 --primary diff --git a/tmux.conf b/tmux.conf index 4ffc3a5..b6b95d8 100644 --- a/tmux.conf +++ b/tmux.conf @@ -24,15 +24,15 @@ setw -g mode-keys vi # change color #set -g pane-border-style 'fg=#660033' #set -g pane-active-border-style 'fg=#990033 bg=default' -set -g pane-border-style 'fg=#990000' -set -g pane-active-border-style 'fg=#ff0000' +set -g pane-border-style 'fg=#000055' +set -g pane-active-border-style 'fg=#6a00aa' # status bar -set -g status-position bottom +set -g status-position top set -g status-justify left #set -g status-style 'fg=#660033 bg=#202020' -set -g status-style 'fg=#990000 bg=#330000' +set -g status-style 'fg=#a000ff bg=#202020' # native xterm scrolling set -g mouse on @@ -45,6 +45,7 @@ set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @resurrect-capture-pane-contents 'on' set -g @resurrect-strategy-vim 'session' set -g @resurrect-strategy-nvim 'session' +set -g @resurrect-processes 'ssh vim nvim django-run "~manage.py"' set -g @plugin 'tmux-plugins/tmux-yank' diff --git a/vimrc b/vimrc index 5d654bc..2b375ae 100644 --- a/vimrc +++ b/vimrc @@ -116,7 +116,6 @@ imap => " Can't be bothered to understand ESC vs in insert mode imap " Clear the search buffer when hitting return -:nnoremap :nohlsearch nnoremap """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -185,6 +184,8 @@ function LightlineFilename() return expand('%') endfunction +"set statusline+=%{gutentags#statusline()} + " Bootstrap autoreload if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs @@ -194,6 +195,9 @@ endif call plug#begin('~/.vim/plugged') +Plug 'liuchengxu/space-vim-dark' +Plug 'kyoz/purify', { 'rtp': 'vim' } + Plug 'https://github.com/preservim/nerdtree' Plug 'https://github.com/Xuyuanp/nerdtree-git-plugin.git' Plug 'https://github.com/tiagofumo/vim-nerdtree-syntax-highlight' @@ -258,7 +262,7 @@ let g:lightline = { \ 'left': [ [ 'filename', 'gitversion' ] ], \ }, \ 'component_function': { - \ 'gitbranch': 'fugitive#head', + \ 'gitbranch': 'FugitiveHead', \ 'filename': 'LightlineFilename', \ }, \ 'component_expand': { @@ -288,8 +292,8 @@ let g:NERDTrimTrailingWhitespace = 1 " Enable NERDCommenterToggle to check all selected lines is commented or not let g:NERDToggleCheckAllLines = 1 -Plug 'https://github.com/mcchrish/nnn.vim' -nnoremap nn :NnnPicker -de '%:p:h' +"Plug 'https://github.com/mcchrish/nnn.vim' +"nnoremap nn :NnnPicker -de '%:p:h' let g:nnn#action = { \ '': 'tab-split', @@ -355,7 +359,10 @@ let g:mkdp_open_ip = '' " specify browser to open preview page " default: '' -let g:mkdp_browser = '' +function OpenMarkdownPreview (url) + execute "silent ! firefox --new-window " . a:url + endfunction +let g:mkdp_browserfunc = 'OpenMarkdownPreview' " set to 1, echo preview page url in command line when open preview page " default is 0 @@ -419,11 +426,29 @@ Plug 'godlygeek/tabular' Plug 'plasticboy/vim-markdown' "Plug 'pwntester/octo.vim' -"Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' +Plug 'fannheyward/telescope-coc.nvim' + +Plug 'https://github.com/ludovicchabant/vim-gutentags.git' + +" API testing +"Plug 'baverman/vial' +"Plug 'baverman/vial-http' + +Plug 'emaniacs/vim-rest-console' + +let g:vrc_output_buffer_name = '__VRC_OUTPUT.json' + +let g:python3_host_prog = "/home/legrems/miniconda3/bin/python" +let g:vial_python = 'python3' + + +set hidden +filetype plugin on call plug#end() @@ -496,14 +521,18 @@ nnoremap :tab Git diff " Using git-delta " Buffer +" Bind a command to exclude some file extensions in the Ag search +" command! -bang -nargs=* Ag call fzf#vim#ag(, '--ignore="*.js,*html"', fzf#vim#with_preview(), 0) + "" F1-12 Shortcuts nnoremap :tabprevious nnoremap :tabnext nnoremap :GV nnoremap :tab Git show - nnoremap :Git rebase -i HEAD~ -nnoremap :SyntasticCheck -nnoremap :SyntasticReset + +nnoremap gp :Git pull +nnoremap gnb :Git checkout -b " Fold / unfold with space nnoremap za @@ -513,22 +542,35 @@ nnoremap dl d$ nnoremap :bprevious nnoremap :bnext +" Goto file under location +nnoremap gf :vertical wincmd f + nnoremap o nnoremap O -nnoremap / Telescope search_history -"nnoremap ch Telescope command_history -nnoremap ch CocCommand fzf-preview.CommandPalette -"nnoremap gc Telescope git_commits -nnoremap gc CocCommand fzf-preview.GitLogs -"nnoremap gb Telescope git_branches -nnoremap gb CocCommand fzf-preview.GitBranches -"nnoremap gss Telescope git_status -nnoremap gss CocCommand fzf-preview.GitStatus -"nnoremap gsc Telescope git_stash -nnoremap gsc CocCommand fzf-preview.GitStashes +"nnoremap ra CocCommand rest-client.request +nnoremap ra call VrcQuery() -nnoremap iss ! glab issue list +nnoremap rr source $MYVIMRC +nnoremap ww Telescope coc commands + +nnoremap / Telescope search_history +nnoremap ch Telescope command_history +"nnoremap ch CocCommand fzf-preview.CommandPalette +nnoremap gk CocCommand fzf-preview.GitActions +"nnoremap gc Telescope git_commits +nnoremap gc lua require('telescope.custom').my_git_commits() +"nnoremap gc CocCommand fzf-preview.GitLogs +nnoremap gbb Telescope git_branches +nnoremap gbc lua require('telescope.custom').my_git_bcommits() +"nnoremap gb CocCommand fzf-preview.GitBranches +"nnoremap gss Telescope git_status +nnoremap gss lua require('telescope.custom').my_git_status() +"nnoremap gss CocCommand fzf-preview.GitStatus +nnoremap gsh Telescope git_stash +"nnoremap gsc CocCommand fzf-preview.GitStashes + +"nnoremap iss ! glab issue list " Copy into temp file vmap y :w! /tmp/vimtmp @@ -540,3 +582,18 @@ nmap oo :call setreg('+', expand("%:h") . "/" . expand("%:t") . "#L" . l nmap xx :%!xxd + +nnoremap n :noh + +colorscheme space-vim-dark + +hi Normal ctermbg=NONE guibg=NONE +hi LineNr ctermbg=NONE guibg=NONE +hi SignColumn ctermbg=NONE guibg=NONE +hi Comment guifg=#5C6370 ctermfg=59 + +" Load custom telescope modification +lua require('telescope.custom') + +" Load telescope-coc extension +lua require('telescope').load_extension('coc') diff --git a/xinitrc b/xinitrc index 7650150..49d7533 100644 --- a/xinitrc +++ b/xinitrc @@ -41,9 +41,8 @@ fi # exec xterm -geometry 80x66+0+0 -name login xrandr --setprovideroutputsource modesetting NVIDIA-0 -xrandr --auto -$HOME/.config/xrandr-magic.sh $MONITOR -$HOME/.config/manipulate_monitors.sh $MONITOR rtl +#xrandr --auto +xrandr --output eDP1 --mode 2560x1440 --scale 1x1 --primary # Swap caps + escape setxkbmap -option caps:swapescape @@ -53,6 +52,8 @@ setxkbmap -option caps:swapescape #feh --bg-fill ~/Downloads/digital-abstract-3d-render-pattern-minimal-art-black-3840x2160-7124.jpg feh --bg-fill ~/Downloads/wp2618248-blackarch-wallpaper.png +xfsettingsd --sm-client-disable & + # Launch i3 exec i3 /usr/bin/prime-offload diff --git a/zsh/alias.sh b/zsh/alias.sh index a23aa6b..2f54871 100644 --- a/zsh/alias.sh +++ b/zsh/alias.sh @@ -40,6 +40,8 @@ make_venv() { echo $(basename $(pwd) | awk '{print "conda deactivate "}') > $(pwd | awk '{print $1"/.autoenv_leave.zsh"}') } +alias activate_venv_gestion="cda arcanite-gestion39 && cd /home/legrems/Documents/Arcanite/arcanite-gestion/arcanite_gestion/" + alias cls="ls -lha --color=always -F --group-directories-first |awk '{k=0;s=0;for(i=0;i<=8;i++){;k+=((substr(\$1,i+2,1)~/[rwxst]/)*2^(8-i));};j=4;for(i=4;i<=10;i+=3){;s+=((substr(\$1,i,1)~/[stST]/)*j);j/=2;};if(k){;printf(\"%0o%0o \",s,k);};print;}'" alias lcs="ls -lhaS --color=always -F --group-directories-first |awk '{k=0;s=0;for(i=0;i<=8;i++){;k+=((substr(\$1,i+2,1)~/[rwxst]/)*2^(8-i));};j=4;for(i=4;i<=10;i+=3){;s+=((substr(\$1,i,1)~/[stST]/)*j);j/=2;};if(k){;printf(\"%0o%0o \",s,k);};print;}'" diff --git a/zsh/generic.sh b/zsh/generic.sh index afe1769..42f65a3 100644 --- a/zsh/generic.sh +++ b/zsh/generic.sh @@ -29,7 +29,7 @@ export PATH=$HOME/custom_commands:$PATH export NB_MINIONS=4 export VAGRANT_TYPE='abacus-abahost' export NB_HAPROXY=2 -export NB_PROXMOXS=1 +export NB_PROXMOXS=2 export VAGRANT_ABACUS_BOX="ubuntu/focal64" export VISUAL=nvim export EDITOR=nvim diff --git a/zshrc b/zshrc index 56197b9..e3590d8 100644 --- a/zshrc +++ b/zshrc @@ -27,3 +27,11 @@ fi unset __conda_setup # <<< conda initialize <<< + +# PM functions +source /home/legrems/.pm/pm.zsh +alias pma="pm add" +alias pmg="pm go" +alias pmrm="pm remove" +alias pml="pm list" +# end PM