我可以使用 Ctrl + ] 跳转到光标下单词的定义,我可以使用 Ctrl + O 跳回我来自的地方。但是,如果我做一些像控制点击某事的东西,那个跳转列表似乎并没有记录我来自哪里。 Ctrl + O 然后不会跳回我控制点击时的位置。
有没有办法确保跳转列表不会错过这个?
答案 0 :(得分:1)
tag stack存储用于跳转到/来自的所有标签。
:tag
用于跳转到标记堆栈中的下一个条目。jump list存储光标跳转到的所有位置。根据Vim的文档,在以下条件下,动作被认为是“跳跃”:
A "jump" is one of the following commands: "'"', "`", "G", "/", "?", "n",
"N", "%", "(", ")", "[[", "]]", "{", "}", ":s", ":tag", "L", "M", "H" and
the commands that start editing a new file.
g<LeftMouse> *g<LeftMouse>*
<C-LeftMouse> *<C-LeftMouse>* *CTRL-]*
CTRL-] Jump to the definition of the keyword under the
cursor. Same as ":tag {ident}", where {ident} is the
keyword under or after cursor.
When there are several matching tags for {ident}, jump
to the [count] one. When no [count] is given the
first one is jumped to. See |tag-matchlist| for
jumping to other matching tags.
{Vi: identifier after the cursor}
g<RightMouse> *g<RightMouse>*
<C-RightMouse> *<C-RightMouse>* *CTRL-T*
CTRL-T Jump to [count] older entry in the tag stack
(default 1). {not in Vi}
*:po* *:pop* *E555* *E556*
:[count]po[p][!] Jump to [count] older entry in tag stack (default 1).
See |tag-!| for [!]. {not in Vi}
:[count]ta[g][!] Jump to [count] newer entry in tag stack (default 1).
See |tag-!| for [!]. {not in Vi}
*CTRL-O*
CTRL-O Go to [count] Older cursor position in jump list
(not a motion command). {not in Vi}
{not available without the |+jumplist| feature}
<Tab> or *CTRL-I* *<Tab>*
CTRL-I Go to [count] newer cursor position in jump list
(not a motion command).
In a |quickfix-window| it takes you to the position of
the error under the cursor.
{not in Vi}
{not available without the |+jumplist| feature}