liuchengxu / vim-which-key

:tulip: Vim plugin that shows keybindings in popup
https://liuchengxu.github.io/vim-which-key/
MIT License
1.93k stars 66 forks source link

why gitgutter automaticly add binding to my space menu ? #36

Closed 4vrel closed 5 years ago

4vrel commented 5 years ago

Hello, After installing gitgutter with vim-plug, I was surprised that which_key_map.h was assign to 'prefix' and this menu was filled with : p → GitGutterPreviewHunk
u → GitGutterUndoHunk
s → GitGutterStageHunk
Where does this mapping come from and how can I edit it ?

liuchengxu commented 5 years ago

These mappings are defined by vim-gitgutter, see https://github.com/airblade/vim-gitgutter/blob/2dce8e032b9c1989a41296aaeccc8f17dc83c707/autoload/gitgutter.vim#L123-L131.

vim-which-key would parse these mapping automatically. To override these auto parsed items by defining them explicitly:

let g:which_map.h = {
      \ 'name' : '+help',
      \ 'p': [':echom "hello"', 'echo hello']
      \ }
ironfish commented 4 years ago

@4vrel based on your question, I am assuming you want to hide the Gitgutter stuff? If that is the case, then this will work:

let g:which_key_map.h = {'name' : 'which_key_ignore'}
let g:which_key_map.h.p = 'which_key_ignore'
let g:which_key_map.h.s = 'which_key_ignore'
let g:which_key_map.h.u = 'which_key_ignore'