Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump back and forth between previous/next cursor positions, limited to current buffer only?

Tags:

vim

I like the functionality of <C-O> and <C-I> to go back and forth to different positions. But many times I would prefer to stay within the current buffer, and always get taken by surprise when a new buffer opens up replacing the one I was looking at.

(1) Is there a way to achieve this? i.e., limit <C-O> and <C-I> to the same buffer?

(2) Is there a way to visit all cursor moves, even those that are not normally considered jumps, e.g. 10k?

like image 476
Jeet Avatar asked Sep 16 '10 22:09

Jeet


1 Answers

As for moving in the same file, check out the '' command. It will jump back and forth between the current location and the last jump.

like image 83
rlduffy Avatar answered Oct 02 '22 05:10

rlduffy