justinmk / vim-sneak

The missing motion for Vim :athletic_shoe:
http://www.vim.org/scripts/script.php?script_id=4809
MIT License
3.24k stars 88 forks source link

How to remap s to other key and s work as the default command in vim (subsititute)? #297

Closed woshichuanqilz closed 2 years ago

woshichuanqilz commented 2 years ago
To "disable" Sneak default mappings, simply define any other mapping to the
relevant <Plug> key. For example to prevent Sneak from remapping "s" and "S",
just map to <Plug>Sneak_s and <Plug>Sneak_S as shown below.

I already check the content here. and make the remap:

nmap ? <Plug>Sneak_s
nmap ? <Plug>Sneak_S
" visual-mode
xmap ? <Plug>Sneak_s
xmap ? <Plug>Sneak_S
" operator-pending-mode
omap ? <Plug>Sneak_s
omap ? <Plug>Sneak_S

The mark ? work as the sneak command now but the s still work as sneak command too. How to make it as the default command ?

woshichuanqilz commented 2 years ago

Got it, you have to change the whole content here.

" 2-character Sneak (default)
nmap ? <Plug>Sneak_s
nmap ? <Plug>Sneak_S
" visual-mode
xmap ? <Plug>Sneak_s
xmap ? <Plug>Sneak_S
" operator-pending-mode
omap ? <Plug>Sneak_s
omap ? <Plug>Sneak_S
" repeat motion
map ? <Plug>Sneak_;
map ? <Plug>Sneak_,
" 1-character enhanced 'f'
nmap ? <Plug>Sneak_f
nmap ? <Plug>Sneak_F
" visual-mode
xmap ? <Plug>Sneak_f
xmap ? <Plug>Sneak_F
" operator-pending-mode
omap ? <Plug>Sneak_f
omap ? <Plug>Sneak_F
" 1-character enhanced 't'
nmap ? <Plug>Sneak_t
nmap ? <Plug>Sneak_T
" visual-mode
xmap ? <Plug>Sneak_t
xmap ? <Plug>Sneak_T
" operator-pending-mode
omap ? <Plug>Sneak_t
omap ? <Plug>Sneak_T
" label-mode
nmap ? <Plug>SneakLabel_s
nmap ? <Plug>SneakLabel_S