@@ -257,8 +257,14 @@ colorscheme tokyonight
257
257
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
258
258
" => whichkey {{{1
259
259
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
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>
262
268
let g: which_key_map = {}
263
269
" Direct maps
264
270
let g: which_key_map .u = ' Find recent files'
@@ -325,26 +331,46 @@ let g:which_key_map.r = {
325
331
\ ' name' : ' +replace' ,
326
332
\ }
327
333
334
+ " Code/ Format/ Change
335
+ let g: which_key_map .c = {
336
+ \ ' name' : ' +code/format/change' ,
337
+ \ ' d' : ' Change to current buffer directory' ,
338
+ \ }
328
339
call which_key#register (' <Space>' , ' g:which_key_map' )
329
340
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>
348
374
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
349
375
" Modeline
350
376
" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
0 commit comments