My vim plugin has a command to jump to a different location (just like tags).
I use the cursor
function for that.
How do I record the previous location in the jumplist, so that Ctrl+O works as expected?
I myself also wanted to this, and what works for me was mark ` before cursor move.
normal! m`
call cursor(l, c)
As help indicate, both setpos() and cursor() don't modify jumplist, so what's the difference of setpos() and cursor(), strange!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With