3

I know that we can move our cursor back by using Ctrl+o and Ctrl+i. ( ref Move cursor to its last position )

But how about when we want to trace back our moves like hjkl?

Are there any way for that?

1 Answer 1

8

That would be an awful lot of jumps, wouldn't it? The jump list would quickly fill up and lose it's effectiveness (as it's limited to 100 entries).

What you can do is explicitly set a jump mark with m' before doing the jump.

Some people change the j and k commands to record a jump when a [count] larger than 1 is given:

:nnoremap <silent> k :<C-U>execute 'normal!' (v:count > 1 ? "m'" . v:count : '') . 'k'<CR>
:nnoremap <silent> j :<C-U>execute 'normal!' (v:count > 1 ? "m'" . v:count : '') . 'j'<CR>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.