diff --git a/cfg/15-buffers.vim b/cfg/15-buffers.vim index 244e919..6f108aa 100644 --- a/cfg/15-buffers.vim +++ b/cfg/15-buffers.vim @@ -1,9 +1,5 @@ set hidden " Don't close buffers -" Buffer navigation -nnoremap :bprev -nnoremap :bnext - " Close buffer function CloseCurrentBuffer( ) let btarget = bufnr( '%' ) @@ -42,4 +38,14 @@ function CloseCurrentBuffer( ) execute l:wcurrent . 'wincmd w' endfunction +" Buffer navigation (Ctrl, Shift, Arrows...) +nnoremap :bprev +nnoremap :bnext nnoremap :call CloseCurrentBuffer() + +" Buffer navigation (Space sequences) +nnoremap bz :enew +nnoremap bq :bprev +nnoremap bd :bnext +nnoremap bw :call CloseCurrentBuffer() +nnoremap bW :bufdo call CloseCurrentBuffer() diff --git a/plugins/vim-which-key.post.vim b/plugins/vim-which-key.post.vim index 20df7a9..81fb275 100644 --- a/plugins/vim-which-key.post.vim +++ b/plugins/vim-which-key.post.vim @@ -20,6 +20,14 @@ let g:which_key_map.o.p = 'paste' let g:which_key_map.o.w = 'whitespace' let g:which_key_map.o.s = 'sign-column' +" Buffers +let g:which_key_map.b = { 'name' : '+buffers' } +let g:which_key_map.b.W = 'close-all' +let g:which_key_map.b.d = 'next' +let g:which_key_map.b.q = 'previous' +let g:which_key_map.b.w = 'close' +let g:which_key_map.b.z = 'new' + " Fuzzy finder let g:which_key_map.p = { 'name' : '+fuzzy-finder' } let g:which_key_map.p.p = 'buffers'