From 7f498c772a10c93b990fbad65b4c54f35ad1f00a Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Wed, 29 Dec 2021 15:53:40 +0100 Subject: [PATCH] plugins: Add vim-which-key --- init.vim | 1 + plugins.vim | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/init.vim b/init.vim index 51804e5..1ad51f0 100644 --- a/init.vim +++ b/init.vim @@ -36,6 +36,7 @@ set colorcolumn=+1 set mouse=a set wildmenu set wildmode=longest,list:full +set showcmd set tabpagemax=100 diff --git a/plugins.vim b/plugins.vim index 538322a..7b9a642 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' @@ -28,7 +29,6 @@ Plug 'lambdalisue/vim-manpager', {'on': 'MANPAGER'} " Make . more useful after a plugin map Plug 'tpope/vim-repeat' - Plug 'flwyd/vim-conjoin' @@ -100,5 +100,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 -- 2.30.2