I'm trying to get VsVim to play nice with EasyMotion, and while I see the merit of a "proper" solution, I think some little tweak in VsVim could actually resolve the issue quite nicely (at least temporarily): As @seatownrocks already mentioned here, the ability to ignore keystrokes in VsVim would be helpful.
I experimented a bit and came up with the following mapping (trying to emulate Spacemacs' bindings):
nmap <silent> <Space><Space> :vsc EasyMotion.Navigate<CR>:
The colon at the end is not forwarded to EasyMotion and prevents unwanted changes to the current document, but I have to hit the Escape-Key after each navigation operation. If VsVim had a colon-command to ignore N keystrokes, one could use a binding like this:
nmap <silent> <Space><Space> :vsc EasyMotion.Navigate<CR>:ignore 2<CR>
This would resolve the issue for now.
somehow it does not work on my vsvim!
Interesting. Could it be that this behavior changes with different extension or VS versions? What are you using?
For me, the first binding still works. I'm currently using VsVim 2.1.2.0 and EasyMotion 1.0 on VS 2015 Update 3.
it works now! thank you!
@jaredpar any word on a fix for better interop between easymotion and vsvim?
VsVim is quite a big beast and this issue is long known. So I think maybe it would be easier to band-aid solve it only from the EasyMotion side. As @mfrischknecht mentioned using
nmap <silent> <Space><Space> :vsc EasyMotion.Navigate<CR>:
works almost ok, but user has to hit Esc afterwards. I haven't developed VS extensions, but wouldn't it be possible to send Esc from EasyMotion? We could add one yes/no setting to EasyMotion called something like "VsVim compatibility mode". If checked, EasyMotion would send Esc after navigation, thus solving the issue (together with one entry in .vimrc)
Closing as duplicate of external issue https://github.com/jaredpar/EasyMotion/issues/3
Most helpful comment
VsVim is quite a big beast and this issue is long known. So I think maybe it would be easier to band-aid solve it only from the EasyMotion side. As @mfrischknecht mentioned using
nmap <silent> <Space><Space> :vsc EasyMotion.Navigate<CR>:
works almost ok, but user has to hit Esc afterwards. I haven't developed VS extensions, but wouldn't it be possible to send Esc from EasyMotion? We could add one yes/no setting to EasyMotion called something like "VsVim compatibility mode". If checked, EasyMotion would send Esc after navigation, thus solving the issue (together with one entry in .vimrc)