Mishkun / ideavim-sneak

Vim-sneak for IdeaVim!
Other
46 stars 10 forks source link

How to remap 's' ? #15

Closed jwav closed 3 years ago

jwav commented 3 years ago

I'm quite used to using 's' to replace a single character. Is there a way to remap 's' in IdeaVim ? In regular Vims, one would use nnoremap <a-s> <Plug>Sneak_s, but it doesn't work in PyCharm.

SOLUTION: Use nmap <a-s> <Plug>(sneak-s) . Note: nnoremap does not work.

Mishkun commented 3 years ago

@jwav Hi! Thanks for raising this question. The correct way to remap is to use <Plug>(sneak-s) try it!

jwav commented 3 years ago

Hi, thank you for answering ; what would the exact nnoremap syntax be ?

I've tried nnoremap <a-s> <Plug>(sneak-s) but as expected it just executes < + P + l...

I've also tried prefacing it with : : nnoremap <a-s> :<Plug>(sneak-s) , nnoremap <a-s> :<Plug>(sneak-s)<CR>, many variations to no avail. PyCharm displays the following error in the lower bar: VIM - Not an editor command: <Plug | <Plug>(sneak-s)

I use PyCharm Community 2020.3.2 on Windows 10, with IdeaVim 0.64 and IdeaVim-Sneak 1.1.1

Mishkun commented 3 years ago

@jwav Using nmap instead of nnoremap work for me just fine full syntax is:

nmap <a-s> <Plug>(sneak-s)
jwav commented 3 years ago

Holy mackerel, it worked 😄 I have no idea why it doesn't work with nnoremap, though. Thanks a lot, Mishkun

Mishkun commented 3 years ago

You are welcome!

DamonBaker commented 3 years ago

How did you manage to restore the s to its original behaviour? Normally I would just add unmap s to .ideavimrc. This works when I run :unmap s manually but I guess since the plugin is loaded after the defaults are set it ends up gets remapped.

jwav commented 3 years ago

To restore 's' to its original VIM behaviour : :nmap s s