Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Mapping #4

Open
vds2212 opened this issue Jan 18, 2024 · 4 comments
Open

Suggestion: Mapping #4

vds2212 opened this issue Jan 18, 2024 · 4 comments

Comments

@vds2212
Copy link

vds2212 commented Jan 18, 2024

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
@rickhowe
Copy link
Owner

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

@vds2212
Copy link
Author

vds2212 commented Jan 18, 2024

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

@gh-liu
Copy link

gh-liu commented Jun 23, 2024

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

@rickhowe
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants