From fc256a3f4fbdc5b6fb857aeed0d388113e69e900 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:02 +0100 Subject: [PATCH 01/11] vim: add FZF and NERDTree .. keybinds --- .config/vim/vimrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 9eca9ec..1e98398 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -35,6 +35,8 @@ set scrolloff=6 set nojoinspaces set updatetime=500 " reduce delay from 4s default +let mapleader="\" + " Autosave settings function! SaveIfExist() if @% != "" && filereadable(@%) && !&readonly @@ -90,6 +92,7 @@ Plugin 'chr4/nginx.vim' Plugin 'PotatoesMaster/i3-vim-syntax' Plugin 'lervag/vimtex' Plugin 'JamshedVesuna/vim-markdown-preview' +Plugin 'junegunn/fzf.vim' call vundle#end() @@ -135,6 +138,12 @@ let g:tagbar_show_linenumbers = 1 let g:tagbar_singleclick = 1 let g:tagbar_autopreview = 1 +" NERDTree configuration +map :NERDTreeToggle + +" FZF configurationn +map :Files + " Disable mouse set mouse=nicr nnoremap @@ -144,7 +153,6 @@ nnoremap inoremap inoremap -let mapleader="\" " Unbind arrow keys for prefix in ['n', 'v'] for key in ['', '', '', ''] @@ -232,6 +240,8 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) \ 'x': ['tsd', 'tsD'], \} + let NERDTreeMapOpenInTab='\t' + endif " Save aliases. From f35e8b8becbab2c0aa8079d0023127f609644c54 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:28 +0100 Subject: [PATCH 02/11] vim: autosave modified files, also when FocusGained --- .config/vim/vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 1e98398..df83efd 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -39,12 +39,12 @@ let mapleader="\" " Autosave settings function! SaveIfExist() - if @% != "" && filereadable(@%) && !&readonly + if @% != "" && filereadable(@%) && !&readonly && &modified write endif endfunction set autowrite -autocmd CursorHold,CursorHoldI,InsertLeave,FocusLost * call SaveIfExist() +autocmd CursorHold,CursorHoldI,InsertLeave,FocusGained,FocusLost * call SaveIfExist() " Search options set hlsearch From f985d47b68821f39b3fe12f36167f0c7ac3012b4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:52:52 +0100 Subject: [PATCH 03/11] vim: split in the direction you'd expect --- .config/vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index df83efd..1af5ded 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -51,6 +51,10 @@ set hlsearch set ignorecase set smartcase +" More natural splits +set splitbelow " Horizontal split below current. +set splitright " Vertical split to right of current. + " GVim settings set guifont=Sauce\ Code\ Pro\ 10.5 set guioptions= From 93e11c73f8968fe72ccd5e2588a7ec0cca7663b1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:53:40 +0100 Subject: [PATCH 04/11] vim: add magic regex to search patterns --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 1af5ded..dd335a6 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -50,6 +50,7 @@ autocmd CursorHold,CursorHoldI,InsertLeave,FocusGained,FocusLost * call SaveIfEx set hlsearch set ignorecase set smartcase +set magic " More natural splits set splitbelow " Horizontal split below current. From 776e641ed0f383eb916137f0568b8a66b93433a6 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:08 +0100 Subject: [PATCH 05/11] vim: add wqa and fat-finger aliases --- .config/vim/vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index dd335a6..48f116f 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -250,11 +250,13 @@ if (exists("g:use_dvorak") && g:use_dvorak == 1) endif " Save aliases. -noremap q :wq com! W w com! Q q com! Wq wq com! WQ wq +com! Wqa wqa +com! WQa wqa +com! WQA wqa " Write with sudo cmap w!! w !sudo tee > /dev/null % From 6da74ddddeb96f52fc1b9950a7b28b791a9d0740 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:36 +0100 Subject: [PATCH 06/11] vim: highlight cursor position with cursor{line,column} --- .config/vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 48f116f..d583902 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -71,6 +71,10 @@ if exists('+colorcolumn') autocmd filetype c,h,cpp,hpp match ErrorMsg '\%>80v.\+' endif +" Highlight line and column of cursor +set cul cuc +highlight CursorLine cterm=NONE ctermbg=8 +highlight CursorColumn cterm=NONE ctermbg=8 " set the runtime path to include Vundle and initialize set rtp+=~/.config/vim/bundle/Vundle.vim From 65c8a2d9a6addf5c72e135dd16b4c1fbe8b1111b Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:54:53 +0100 Subject: [PATCH 07/11] gvim: use consistent font size with system --- .config/vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index d583902..520e14b 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -57,7 +57,7 @@ set splitbelow " Horizontal split below current. set splitright " Vertical split to right of current. " GVim settings -set guifont=Sauce\ Code\ Pro\ 10.5 +set guifont=Sauce\ Code\ Pro\ 9 set guioptions= " Whitespace highlight settings From c797593e9f66c34ad3952eeaa96ebcc74c6884cd Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:55:23 +0100 Subject: [PATCH 08/11] aliases: start vim with servername for lervag/vimtex --- aliases | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aliases b/aliases index cfbd5d8..8b73914 100644 --- a/aliases +++ b/aliases @@ -58,6 +58,8 @@ alias make="make -j$(nproc)" alias dd='dd status=progress' alias env='env | sort' alias ssh="ssh -tt" +alias vim="vim --servername vim -p" +alias vi=vim alias grip='grip --user=frebib --pass=$GRIP_API_KEY' alias acme.sh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' alias acmesh='$XDG_CONFIG_HOME/acme.sh/acme.sh --home $XDG_CONFIG_HOME/acme.sh --config-home $XDG_CONFIG_HOME/acme.sh --log $XDG_CONFIG_HOME/acme.sh/acme.sh.log' From 2b8ab8cb3787a526f6cf73238e8fabd447ba19e4 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 21:55:50 +0100 Subject: [PATCH 09/11] scripts/dock-displays: update fehbg after resize --- scripts/dock-displays | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/dock-displays b/scripts/dock-displays index ac7244f..421f396 100755 --- a/scripts/dock-displays +++ b/scripts/dock-displays @@ -15,3 +15,7 @@ MODENAME=${MODELINE%% *} xrandr --newmode $MODELINE 2>/dev/null || true xrandr --addmode $OUTPUT $MODENAME 2>/dev/null || true xrandr --output $OUTPUT --mode $MODENAME + +if [ -f ~/.fehbg -a -x ~/.fehbg ]; then + ~/.fehbg +fi From eadeba5baaba9e3a7885d81d85efdaeeac0bac86 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Apr 2018 17:09:31 +0100 Subject: [PATCH 10/11] vim: use pretty unicode listchars --- .config/vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 520e14b..100bbd4 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -62,7 +62,7 @@ set guioptions= " Whitespace highlight settings set list -set listchars=eol:$,space:.,tab:>-,trail:~,extends:>,precedes:< +set listchars=eol:$,space:·,tab:>-,trail:◦,extends:▶,precedes:◀ highlight SpecialKey ctermfg=8 if exists('+colorcolumn') From 771cdf4b5dc3fb1f40c5c7cd577d780d88d1e23a Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 3 Apr 2018 17:12:32 +0100 Subject: [PATCH 11/11] vim: disable vimtex autoindent --- .config/vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index 100bbd4..36294f6 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -116,6 +116,7 @@ endif let g:ycm_semantic_triggers.tex = g:vimtex#re#youcompleteme "let g:vimtex_view_method='zathura' let g:tex_flavor='latex' +let g:vimtex_indent_enabled = 0 " auto-indentation is wrong and annoying autocmd FileType tex silent VimtexCompile autocmd FileType tex setlocal spell autocmd FileType tex TagbarOpen