Reputation: 3340
When I execute a replace command, e.g
:%s/toBeReplaced/Replacement/g
Vim jumps to the last occurence of toBeReplaced
. This is quite irritating because I have to go back to the position where I was editing. I've quikly renamed my .vimrc to .vimrc_ in order to disable my personal .vimrc. The same thing happens, hence it seems to be vim's default behavior.
When a replacement command is executed, I want vim to stick at the position where I am editing at that moment. Is there any way to achieve this??
Upvotes: 2
Views: 46
Reputation: 195209
after you executed the :s
, press :
``
will bring you back to the position before your run the cmd.
Upvotes: 8