vimvi

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


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 MANUALLY find my way back to where I was.

Is there an automatic way to go back to where I was when I initiated my last search?


Solution

  • Ctrl+O takes me to the previous location. Don't know about location before the search.

    Edit: Also, `. will take you to the last change you made.