使用键盘箭头键在Vim中导航快速修复标签出现。

huangapple go评论75阅读模式
英文:

use keyboard arrow keys to navigate through the quickfix tag occurences in vim

问题

  1. 当我在关键字下按C-]时,有时会有多个出现,但我必须输入标签出现的编号才能跳转到其实现,就像这样:
    1 F   f    my_function  path/to/first/occurrence.c
                   my_function(void)
    2 F   f    my_function  path/to/second/occurrence.c
                   my_function(void)
    输入编号并按<Enter>键(按q或留空取消):
  1. 我想要显示列表,并使用键盘数组导航其中的元素,我应该使用类似errorformat的东西,还是有其他简单的解决方案?

  2. 我想要得到:

    1. my_function(void) : path/to/first/occurrence.c
    2. my_function(void) : path/to/second/occurrence.c
英文:

currently when i hit C-] under a keyword, sometimes i have many occurences, but i must enter the number of the tag occurence to go to its implementation, like this:

1 F   f    my_function  path/to/first/occurrence.c
               my_function(void)
2 F   f    my_function  path/to/second/occurrence.c
               my_function(void)
Type number and &lt;Enter&gt; (q or empty cancels): 

i want to display the list and to navigate through its elements using keyboard arrays, should i use something like errorformat, or there is an other simple solution

i want to have:

1. my_function(void) : path/to/first/occurrence.c
2. my_function(void) : path/to/second/occurrence.c

答案1

得分: 3

以下是翻译好的部分:

"The output you provided is something that is produced by :tselect command, and this is not quickfix."
你提供的输出是由 :tselect 命令产生的,而不是快速修复。

"To list occurrences in quickfix, use :ltag command, then open the list with :lopen:"
要在快速修复中列出发生的情况,请使用 :ltag 命令,然后使用 :lopen 打开列表:

":ltag <some-keyword>
:lopen"
:ltag <some-keyword>
:lopen

"If you want to activate quickfix entry with arrow keys:"
如果您想要使用箭头键激活快速修复条目:

"autocmd! FileType qf autocmd! CursorMoved <buffer> :execute("norm! &lt;CR>&lt;C-W>w")"
autocmd! FileType qf autocmd! CursorMoved <buffer> :execute("norm! &lt;CR>&lt;C-W>w")

英文:

The output you provided is something that is produced by :tselect command, and this is not quickfix.

To list occurrences in quickfix, use :ltag command, then open the list with :lopen:

:ltag &lt;some-keyword&gt;
:lopen

If you want to activate quickfix entry with arrow keys:

autocmd! FileType qf autocmd! CursorMoved &lt;buffer&gt; :execute(&quot;norm! \&lt;CR&gt;\&lt;C-W&gt;w&quot;)

huangapple
  • 本文由 发表于 2023年8月10日 20:36:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76875800.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定