Skip to content

Commit 27a9c28

Browse files
authored
Update whichkey (#8)
* Clean * More cleaning * Fix whichkey gg * Update whichkey * Update fold marker
1 parent 0c965de commit 27a9c28

File tree

10 files changed

+52
-101
lines changed

10 files changed

+52
-101
lines changed

basic.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,14 @@ function s:Toggle(pattern, dict, ...)
520520
return view
521521
endfunction
522522

523-
" }}} "
524-
525-
" Host specific vim
523+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
524+
" => Host specific vim {{{1
525+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
526526
if filereadable(expand($HOME . '/.vimrc.local'))
527527
source $HOME/.vimrc.local
528528
endif
529529

530+
" }}} "
530531
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
531532
" Modeline
532533
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

ftplugin/css.vim

Lines changed: 0 additions & 4 deletions
This file was deleted.

ftplugin/html.vim

Lines changed: 0 additions & 4 deletions
This file was deleted.

ftplugin/javascript.vim

Lines changed: 0 additions & 4 deletions
This file was deleted.

ftplugin/json.vim

Lines changed: 0 additions & 4 deletions
This file was deleted.

ftplugin/sql.vim

Lines changed: 0 additions & 28 deletions
This file was deleted.

ginit.vim

Lines changed: 0 additions & 12 deletions
This file was deleted.

init.vim

Lines changed: 0 additions & 22 deletions
This file was deleted.

plugins.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ endif
104104

105105
Plug 'liuchengxu/vim-which-key'
106106

107+
"}}}1
108+
107109
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
108110
" Plugs End
109111
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

plugins_config.vim

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,14 @@ colorscheme tokyonight
257257
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
258258
" => whichkey {{{1
259259
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
260-
" Space whihch key
261-
noremap <silent> <leader> :WhichKey '<Space>'<CR>
260+
" Options
261+
let g:which_key_fallback_to_native_key = 1
262+
263+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
264+
" => Space whichkey {{{2
265+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
266+
nnoremap <silent> <leader> :<c-u>WhichKey '<Space>'<CR>
267+
vnoremap <silent> <leader> :<c-u>WhichKeyVisual '<Space>'<CR>
262268
let g:which_key_map = {}
263269
" Direct maps
264270
let g:which_key_map.u = 'Find recent files'
@@ -325,26 +331,46 @@ let g:which_key_map.r = {
325331
\ 'name' : '+replace',
326332
\ }
327333

334+
" Code/ Format/ Change
335+
let g:which_key_map.c = {
336+
\ 'name' : '+code/format/change',
337+
\ 'd' : 'Change to current buffer directory',
338+
\ }
328339
call which_key#register('<Space>', 'g:which_key_map')
329340

330-
" g which key"
331-
" Disabled for now as not working when typing gg
332-
"noremap <silent> g :WhichKey 'g'<CR>
333-
"let g:g_which_key_map = {}
334-
"" Direct maps
335-
"let g:g_which_key_map['%'] = 'Macth pair backward'
336-
"let g:g_which_key_map['='] = 'Indent buffer'
337-
"let g:g_which_key_map['Q'] = 'Format buffer'
338-
"let g:g_which_key_map.l = 'Align right'
339-
"let g:g_which_key_map.L = 'Align left'
340-
"let g:g_which_key_map.c = 'Comment'
341-
"let g:g_which_key_map['cc'] = 'Comment line'
342-
"let g:g_which_key_map.r = 'Replace operator'
343-
"let g:g_which_key_map['rr'] = 'Replace line (with register)'
344-
"let g:g_which_key_map.s = 'Sort operator'
345-
"let g:g_which_key_map['ss'] = 'Sort lines'
346-
"let g:g_which_key_map.V = 'Reselect visual selection'
347-
"call which_key#register('g', 'g:g_which_key_map')
341+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
342+
" => g whichkey {{{2
343+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
344+
nnoremap <silent> g :<c-u>WhichKey 'g'<CR>
345+
vnoremap <silent> g :<c-u>WhichKeyVisual 'g'<CR>
346+
let g:g_which_key_map = {}
347+
" Direct maps
348+
let g:g_which_key_map['%'] = 'Macth pair backward'
349+
let g:g_which_key_map['='] = 'Indent buffer'
350+
let g:g_which_key_map['Q'] = 'Format buffer'
351+
let g:g_which_key_map.l = 'Align right'
352+
let g:g_which_key_map.L = 'Align left'
353+
let g:g_which_key_map.c = 'Comment'
354+
let g:g_which_key_map['cc'] = 'Comment line'
355+
let g:g_which_key_map.r = 'Replace operator'
356+
let g:g_which_key_map['rr'] = 'Replace line (with register)'
357+
let g:g_which_key_map.s = 'Sort operator'
358+
let g:g_which_key_map['ss'] = 'Sort lines'
359+
let g:g_which_key_map.V = 'Reselect visual selection'
360+
" Group
361+
let g:g_which_key_map.o = {
362+
\ 'name' : '+gtfo',
363+
\ }
364+
" Diff
365+
let g:g_which_key_map.d = {
366+
\ 'name' : '+diffget',
367+
\ }
368+
call which_key#register('g', 'g:g_which_key_map')
369+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
370+
" => c whichkey {{{2
371+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
372+
nnoremap <silent> c :<c-u>WhichKey 'c'<CR>
373+
vnoremap <silent> c :<c-u>WhichKeyVisual 'c'<CR>
348374
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
349375
" Modeline
350376
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

0 commit comments

Comments
 (0)