tommcdo / vim-exchange

Easy text exchange operator for Vim
MIT License
756 stars 23 forks source link

support to keep cursor as it was after calling <plug>(Exchange) #56

Closed haolian9 closed 3 years ago

haolian9 commented 3 years ago

context:

the problem is:

So I changed map to vmap X <Plug>(Exchange)E (appended a E), but sometimes the selection is **==not a word.

The cursor jumping is not really matter too much, but when I noticed it, It becoming annoying more and more ...

tommcdo commented 3 years ago

If I'm not mistaken, the cursor moving to the beginning of the selection is the default behavior for operators. For example, see y or gU.

You might be able to use `] and the end of your mapping, which jumps to the end of the previous selection.

haolian9 commented 3 years ago

Thanks for the `] solution, it works nicely.

haolian9 commented 3 years ago

It a shame I did not known about `] before, sorry for the noise, and thank you for the great plugin.