vim-sneak icon indicating copy to clipboard operation
vim-sneak copied to clipboard

Allow us to disable the default keymappings easily

Open aileot opened this issue 4 years ago • 4 comments

Before the PR, the default keymappings sometimes annoyed us, who would like to use s as vim's default (the synonym for cl) and so on.

aileot avatar Feb 29 '20 05:02 aileot

This makes no sense. And plugins that have this kind of option are broken.

Sneak will not map s if the user has mapped <Plug>Sneak_s/S to anything else:

nmap ? <Plug>Sneak_s
nmap ? <Plug>Sneak_S

If that's too much work, then why have Sneak installed in the first place? Its entire purpose is to provide a mapping. If you don't like the default mapping then you need to choose a different mapping (as shown above). So a "disable mappings" option makes no sense.

justinmk avatar Feb 29 '20 22:02 justinmk

Added documentation :help sneak-disable-mappings in 08414770f4bd

justinmk avatar Feb 29 '20 23:02 justinmk

You seems to have overlooked some users

  1. who want to map only with sneak#wrap() flexibly, but without <Plug>Sneak_foo
  2. who want to use Sneak only buffer-locally, like readonly-buffer or in specific filetype/buftype
  3. who only want to use <Plug>Sneak_f/t or <Plug>SneakLabel_s and so on, but without <Plug>Sneak_s

I may also overlook other problems which the feature solve.

Isn't it an easiest, certain way for Sneak users to understand in the analogy of other vim-plugins which have g:foo#no_default_mappings? Or do you have any other reasons to cling to the current, smartest way?

aileot avatar Mar 01 '20 12:03 aileot

Thanks, that is a good list of use cases. In those cases user is going to a lot of trouble already, so this is not much more trouble:

map <f99> <Plug>Sneak_s<Plug>Sneak_S
map! <f99> <Plug>Sneak_s<Plug>Sneak_S

However it's definitely obscure. Sneak has a bunch of weird options already so I guess I will cave here.

justinmk avatar Mar 01 '20 19:03 justinmk