X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=plugins.vim;h=c1c4e6fbb48dafac39735cd3e14635252098c868;hb=db571461dc3410d570e7cee171b07ab567ffd821;hp=538322ad82f1908bf79b9d1db099eddc961a3a95;hpb=298897dcd183ef0b05ff4be7ac221bd219f36291;p=vimconf.git diff --git a/plugins.vim b/plugins.vim index 538322a..c1c4e6f 100644 --- a/plugins.vim +++ b/plugins.vim @@ -8,6 +8,7 @@ Plug 'dstein64/vim-startuptime' Plug 'vim-airline/vim-airline' Plug 'gruvbox-community/gruvbox' +Plug 'liuchengxu/vim-which-key' Plug 'benknoble/vim-auto-origami' @@ -24,11 +25,14 @@ Plug 'junegunn/vim-easy-align' Plug 'thinca/vim-fontzoom' -Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'} +" vim-core on Gentoo does ship a manpager plugin that collides with MANPAGER +" definition. +if has('nvim') || stridx(system("uname -r"), "-gentoo") == -1 + Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'} +endif " Make . more useful after a plugin map Plug 'tpope/vim-repeat' - Plug 'flwyd/vim-conjoin' @@ -100,5 +104,27 @@ function PluginsConfig() au BufEnter *.h* let b:fswitchlocs='reg:/include/lib/,rel:.' au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh' au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp' + + let g:mapleader = "\" + let g:maplocalleader = ',' + nnoremap :WhichKey '' + nnoremap :WhichKey ',' + vnoremap :WhichKeyVisual '' + vnoremap :WhichKeyVisual ',' + + let g:which_key_map = {} + au VimEnter * call which_key#register('', 'g:which_key_map') + let g:which_key_map.b = { + \ 'name': '+buffer', + \ '1': ['b1', 'buffer 1'], + \ '2': ['b2', 'buffer 2'], + \ 'd': ['bd', 'delete-buffer'], + \ 'f': ['bfirst', 'first-buffer'], + \ 'h': ['Startify', 'home-buffer'], + \ 'l': ['blast', 'last-buffer'], + \ 'n': ['bnext', 'next-buffer'], + \ 'p': ['bprevious', 'previous-buffer'], + \ } + endfunction