NavigateBackward in Vim?

Posted by vexe on Stack Overflow See other posts from Stack Overflow or by vexe
Published on 2014-08-23T09:33:37Z Indexed on 2014/08/23 10:21 UTC
Read the original article Hit count: 250

Filed under:
|

So Ctrl-o works only with jumps and has a history, '' gets you back to your last position regardless of how you ended up there (jumping, navigating, etc) but there's no history for it.

What I'm looking for is the best of those two worlds, something like Visual studio's NavigateBackward. Ctrl-o is good but a lot of the times it takes me back to positions I wouldn't expect, jumping is not the only way I navigate...

  1. Is there a built-in command/way in vim that does this?
  2. if not, is there a plugin for it?
  3. if not, I have no problem writing a plugin myself, I know how to set/get the caret position, but I looked at the autocmd-events and couldn't find anything that fires when the caret changes position. How would I go about detecting the 'change' of the caret position?

Thanks.

© Stack Overflow or respective owner

Related posts about vim

Related posts about vimscript