XVim
XVim copied to clipboard
Feature request: '' or `` -- support for jumping back to previous unmarked location (before jumping away)
If you hit two single quotes or two graves/backquotes in vim, it'll jump you back to where you were before your last jump. Think of it as "jump back". It's useful if you go to the top of the page to edit the #include list or if you jump to a marked location to edit something, but didn't mark your previous location. Vim help's definition:
*''* *``*
'' `` To the position before the latest jump, or where the
last "m'" or "m`" command was given. Not set when the
|:keepjumps| command modifier was used.
I think it will be great if this is implemented!
The jump command is not familiar to me. But I implemented two times back tick and two times single quote. If you have time to test this feature, please do it.
I haven't tested it but from reading your diff it looks like you are not taking into consideration the differences between ' and `.
' is a mark at a specific point in the file. ` is a mark to the first non blank in the line where the last cursor position was.
so:
lorem ips|um
lorem ipsum
jumps to here somehow
lorem ipsum
lorem| ipsum
pressing `` would go here:
|lorem ipsum
lorem ipsum
and pressing '' would go here again:
lorem ips|um
lorem ipsum
doing '' again from there it would be:
lorem ipsum
lorem| ipsum
and `` would be:
lorem ipsum
|lorem ipsum
Thank you for your comment. First of all, ' (single quote) means first non-blank character and `(backtick) means specified point. Your understanding is opposite.
I tested '' and `` in original vim and confirmed that commands behaved in the same way.
so:
lorem ipsum
lorem| ipsum
pressing ma and move with cursor to here:
lorem ip|sum
lorem ipsum
pressing `a go here:
lorem ipsum
lorem| ipsum
pressing `` go here:
lorem ip|sum
lorem ipsum
and pressing `` go here:
lorem ipsum
lorem| ipsum
and pressing '' go here:
|lorem ipsum
lorem ipsum
m' and m` set each separate mark, but this may be bad. I will correct this point. please wait for merge.
If you have any other wrong motion behavior compared to original vim, please tell me.
Yeah my bad. It's the opposite of what I typed. My point remains that they should be treated differently though upon invocation of the mark movement command.
It seems the original vim use '(single quote) mark for both ' and `.
:marks
mark line col file/text
' 12 16 lorem ipsum
I correct in #326.
Should work in refactoring branch now. (Close after release)
Neither '' nor `` seem to work?