Intellij VIM 模式,跳转列表 (CTRL-O) 不记录导航

Mik*_*ike 6 vim intellij-idea

我可以使用Ctrl+]跳转到光标下单词的定义,我可以使用Ctrl+O跳转回我来自的地方。但是如果我做一些类似控制点击某事的事情,那个跳转列表似乎并没有记录我来自哪里。Ctrl+O然后不会跳回到我点击控制键时所在的位置。

有没有办法确保跳转列表不会错过这个?

Vit*_*tor 5

标签导航

标签堆栈存储用于跳转到/自的所有标签。

  • ctrl]用于跟随光标下的标签。
  • ctrlt用于跳转到标签堆栈中的上一个条目。
  • :tag用于跳转到标签堆栈中的下一个条目。

跳跃导航

跳转列表存储光标跳转到/跳出的所有位置。根据 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.
Run Code Online (Sandbox Code Playgroud)
  • ctrlo用于移动光标以执行跳转列表中较旧的条目。
  • ctrli用于将光标移动到跳转列表中较新的条目。

参考

:help tag-commands:

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}
Run Code Online (Sandbox Code Playgroud)

:help tag-stack:

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}
Run Code Online (Sandbox Code Playgroud)

:help jump-motions:

                            *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}
Run Code Online (Sandbox Code Playgroud)

  • 似乎 IdeaVim 所做的任何“跳转”都会记录在跳转列表中,但 IDE 所做的任何“跳转”都不会记录在跳转列表中。例如,ctrl-] 您可以使用 ctrl-o 返回。但使用F4无法从使用ctrl-o返回。那么问题来了,我们怎样才能避免跳转列表遗漏IDE所做的跳转呢? (7认同)