summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keys/which-key.vim41
-rw-r--r--plug-config/coc.vim2
-rw-r--r--plug-config/goyo.vim2
3 files changed, 33 insertions, 12 deletions
diff --git a/keys/which-key.vim b/keys/which-key.vim
index 0c84750f..7327dcd0 100644
--- a/keys/which-key.vim
+++ b/keys/which-key.vim
@@ -1,9 +1,13 @@
+" Map leader to which_key
+nnoremap <silent> <leader> :silent WhichKey '<Space>'<CR>
+vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR>
+
+" Create map to add keys to
let g:which_key_map = {}
+" Define a separator
let g:which_key_sep = '→'
" set timeoutlen=100
-nnoremap <silent> <leader> :silent WhichKey '<Space>'<CR>
-vnoremap <silent> <leader> :silent <c-u> :silent WhichKeyVisual '<Space>'<CR>
" Not a fan of floating windows for this
let g:which_key_use_floating_win = 0
@@ -20,22 +24,38 @@ autocmd FileType which_key set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler
" change to nerd commenter
-let g:which_key_map['/'] = [ '<Plug>NERDCommenterToggle' , 'commenter' ]
-let g:which_key_map['.'] = [ ':CocConfig' , 'CoC config' ]
+let g:which_key_map['/'] = [ '<Plug>NERDCommenterToggle' , 'comment' ]
+let g:which_key_map['.'] = [ ':e $MYVIMRC' , 'open init' ]
let g:which_key_map[';'] = [ ':Commands' , 'commands' ]
+let g:which_key_map['='] = [ '<C-W>=' , 'balance windows' ]
let g:which_key_map['d'] = [ ':bd' , 'delete buffer']
let g:which_key_map['e'] = [ ':CocCommand explorer' , 'explorer' ]
-let g:which_key_map['f'] = [ ':Files' , 'files' ]
+let g:which_key_map['f'] = [ ':Files' , 'search files' ]
let g:which_key_map['h'] = [ '<C-W>s' , 'split below']
let g:which_key_map['q'] = [ 'q' , 'quit' ]
let g:which_key_map['r'] = [ ':Ranger' , 'ranger' ]
let g:which_key_map['S'] = [ ':Startify' , 'start screen' ]
+let g:which_key_map['T'] = [ ':Rg' , 'search text' ]
let g:which_key_map['v'] = [ '<C-W>v' , 'split right']
+let g:which_key_map['w'] = [ 'w' , 'write' ]
let g:which_key_map['z'] = [ 'Goyo' , 'zen' ]
-" f is for find
-let g:which_key_map.f = {
- \ 'name' : '+find' ,
+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'] ,
+ \ '?' : ['Buffers' , 'fzf-buffer'] ,
+ \ }
+
+" s is for search
+let g:which_key_map.s = {
+ \ 'name' : '+search' ,
\ '/' : [':History/' , 'history'],
\ ';' : [':Commands' , 'commands'],
\ 'a' : [':Ag' , 'text Ag'],
@@ -52,10 +72,10 @@ let g:which_key_map.f = {
\ 'm' : [':Marks' , 'marks'] ,
\ 'M' : [':Maps' , 'normal maps'] ,
\ 'p' : [':Helptags' , 'help tags'] ,
- \ 'r' : [':Rg' , 'text Rg'],
+ \ 'P' : [':Tags' , 'project tags'],
\ 's' : [':Snippets' , 'snippets'],
\ 'S' : [':Colors' , 'color schemes'],
- \ 't' : [':Tags' , 'project tags'],
+ \ 't' : [':Rg' , 'text Rg'],
\ 'T' : [':BTags' , 'buffer tags'],
\ 'w' : [':Windows' , 'search windows'],
\ 'y' : [':Filetypes' , 'file types'],
@@ -140,6 +160,7 @@ let g:which_key_map.t = {
\ 'v' : [':Vista!!' , 'tag viewer'],
\ }
+" Register which key map
call which_key#register('<Space>', "g:which_key_map")
diff --git a/plug-config/coc.vim b/plug-config/coc.vim
index 7ed888ce..709f971d 100644
--- a/plug-config/coc.vim
+++ b/plug-config/coc.vim
@@ -65,7 +65,7 @@ endfunction
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
-nmap <leader>rn <Plug>(coc-rename)
+" nmap <leader>rn <Plug>(coc-rename)
augroup mygroup
autocmd!
diff --git a/plug-config/goyo.vim b/plug-config/goyo.vim
index 1f5b17ac..f83965af 100644
--- a/plug-config/goyo.vim
+++ b/plug-config/goyo.vim
@@ -1 +1 @@
-nmap <silent> <leader>z :Goyo<CR>
+" nmap <silent> <leader>z :Goyo<CR>