spotdiff.vim
spotdiff.vim copied to clipboard
Suggestion: Mapping
The mapping creates a number of default mappings:
-
<leader>t
-
<leader>T
-
<leader>o
-
<leader>O
-
<leader>u
These default mapping can conflict with user mappings. It would be good if the plugin had an option to not create the default mappings
e.g.:
vim-maximizer has:
let g:maximizer_set_default_mapping = 0
is.vim has:
let g:is#do_default_mappings = 0
context has:
let g:context_add_mappings = 0
bufexplorer has:
let g:bufExplorerDisableDefaultKeyMapping = 1
ferret has:
let g:FerretMap = 0
fern has:
let g:fern#disable_default_mappings = 1
nerd commenter has:
let g:NERDCreateDefaultMappings = 0
vimspector has:
let g:vimspector_enable_mappings = 'VISUAL_STUDIO'
Currently I have the following section in my vimrc
:
augroup spotfiff
autocmd! VimEnter * nunmap <leader>t
autocmd! VimEnter * nunmap <leader>T
autocmd! VimEnter * nunmap <leader>o
autocmd! VimEnter * nunmap <leader>O
autocmd! VimEnter * nunmap <leader>u
augroup END
The plugin does not map those keys if already mapped. And, not documented but g:VDiffDoMapping
can be 0
to disable those key mapping.
Thanks for the answer :-) I'll use the flag in my config :-)
@rickhowe If I understand correctly, the [b ]b [e ]e
mappings are only valid for a period of time when diffing. Maybe use the OptionSet
event for the diff
option: when diff is on, map the keys; when diff is off, unmap the keys.
Thank you for asking. User can anytime map his/her favorite keys to plugin operations and unmap them. It might cause a conflict and an accident so I am afraid to handle the mappings.