In vim, how do I go back to where I was before a search?

前端 未结 7 879
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-29 17:07

Programming in vim I often go search for something, yank it, then go back to where I was, insert it, modify it.

The problem is that after I search and find, I need to MA

7条回答
  •  天命终不由人
    2021-01-29 17:47

    I use this one:

    nnoremap / ms/
    nnoremap ? ms?
    

    Then if I search something by using / or ?, I can go back quickly by `s. You could replace the letter s to any letter you like.

提交回复
热议问题