Chris пре 5 година
родитељ
комит
bcd7a4ff30
3 измењених фајлова са 33 додато и 12 уклоњено
  1. 31 10
      keys/which-key.vim
  2. 1 1
      plug-config/coc.vim
  3. 1 1
      plug-config/goyo.vim

+ 31 - 10
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")
 
 

+ 1 - 1
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!

+ 1 - 1
plug-config/goyo.vim

@@ -1 +1 @@
-nmap <silent> <leader>z :Goyo<CR>
+" nmap <silent> <leader>z :Goyo<CR>