You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when pressing % to jump to a matching symbol and land somewhere completely unexpected (or do any other kind of long distance movement), you may want to quickly jump back.
For that, adding support for jumps is more useful than hard to implement.
''`` (To the position before the latest jump, or where the last "m'" or "m`" command was given.)
<Ctrl>+O
<Ctrl>+I
To quote vim doc
A "jump" is a command that normally moves the cursor several lines away. If
you make the cursor "jump" the position of the cursor before the jump is
remembered. You can return to that position with the "''" and "``" commands,
unless the line containing that position was changed or deleted. The
following commands are "jump" commands: "'", "`", "G", "/", "?", "n", "N",
"%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and the
commands that start editing a new file.
Jumps are remembered in a jump list. With the CTRL-O and CTRL-I command you
can go to cursor positions before older jumps, and back again. Thus you can
move up and down the list. There is a separate jump list for each window.
The maximum number of entries is fixed at 100.
There's more interesting stuff that might be worth adding, see :help mark-motions in vim.
Applying this to a terminal
I think most important is to add some sort of jump list (maybe start capping it to 100, just like in vim) and then make sure that certain jumps are recorded into that jump list.
An item in a jump list would probably be simply a CellLocation. This means, line values are relative. negative points into the history. This also means, that when adding new lines, each recorded line location would needed to be adjusted accordingly. I wonder if that one could be optimized (or if that doesn't matter at all, perf wise).
The jump list should probably be remembered per screen buffer, because each screen buffer might most likely have different history line counts. Most likely, jump list only make sense when having a history at all.
The text was updated successfully, but these errors were encountered:
when pressing
%
to jump to a matching symbol and land somewhere completely unexpected (or do any other kind of long distance movement), you may want to quickly jump back.For that, adding support for jumps is more useful than hard to implement.
''
``
(To the position before the latest jump, or where the last "m'" or "m`" command was given.)<Ctrl>+O
<Ctrl>+I
To quote vim doc
There's more interesting stuff that might be worth adding, see
:help mark-motions
in vim.Applying this to a terminal
I think most important is to add some sort of jump list (maybe start capping it to 100, just like in vim) and then make sure that certain jumps are recorded into that jump list.
An item in a jump list would probably be simply a
CellLocation
. This means, line values are relative. negative points into the history. This also means, that when adding new lines, each recorded line location would needed to be adjusted accordingly. I wonder if that one could be optimized (or if that doesn't matter at all, perf wise).The jump list should probably be remembered per screen buffer, because each screen buffer might most likely have different history line counts. Most likely, jump list only make sense when having a history at all.
The text was updated successfully, but these errors were encountered: