spotdiff.vim icon indicating copy to clipboard operation
spotdiff.vim copied to clipboard

Suggestion: Mapping

Open vds2212 opened this issue 1 year ago • 4 comments

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

vds2212 avatar Jan 18 '24 06:01 vds2212

The plugin does not map those keys if already mapped. And, not documented but g:VDiffDoMapping can be 0 to disable those key mapping.

rickhowe avatar Jan 18 '24 07:01 rickhowe

Thanks for the answer :-) I'll use the flag in my config :-)

vds2212 avatar Jan 18 '24 10:01 vds2212

@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.

gh-liu avatar Jun 23 '24 13:06 gh-liu

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.

rickhowe avatar Jun 25 '24 04:06 rickhowe