XVim icon indicating copy to clipboard operation
XVim copied to clipboard

Feature request: '' or `` -- support for jumping back to previous unmarked location (before jumping away)

Open myster-t opened this issue 13 years ago • 8 comments

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.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/900198-feature-request-or-support-for-jumping-back-to-previous-unmarked-location-before-jumping-away?utm_campaign=plugin&utm_content=tracker%2F252770&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F252770&utm_medium=issues&utm_source=github).

myster-t avatar Aug 31 '12 17:08 myster-t

I think it will be great if this is implemented!

NSCoder avatar Oct 12 '12 05:10 NSCoder

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.

pebble8888 avatar Dec 24 '12 02:12 pebble8888

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

weaksauce avatar Jan 13 '13 21:01 weaksauce

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.

pebble8888 avatar Jan 14 '13 06:01 pebble8888

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.

weaksauce avatar Jan 14 '13 06:01 weaksauce

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.

pebble8888 avatar Jan 14 '13 07:01 pebble8888

Should work in refactoring branch now. (Close after release)

JugglerShu avatar Jul 17 '13 08:07 JugglerShu

Neither '' nor `` seem to work?

Francescu avatar Sep 09 '14 10:09 Francescu