Eclipse 导航到下一个/上一个标记的事件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4019818/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse navigate to next/previous marked occurrence
提问by Steve Kuo
Eclipse has the Mark Occurrences feature where it highlights all occurrences of a selected variable/method. Is there a way to navigate to next or previous marked occurrence?
Eclipse 具有标记出现的功能,它突出显示所选变量/方法的所有出现。有没有办法导航到下一个或上一个标记的事件?
采纳答案by Rebecca Chernoff
After selecting a piece of text:
选择一段文字后:
Next occurrence is ctrl+k.
Previous occurrence is ctrl+shift+k.
下一次出现是ctrl+ k。
先前出现的是ctrl+ shift+ k。
回答by Duncan Jones
To skip between highlighted occurrences only, try the following:
要仅在突出显示的事件之间跳过,请尝试以下操作:
Above the editor Window, select the down arrow next to the next annotation button.
Adjust the selection so that only "Occurrences" is marked.
在编辑器窗口上方,选择下一个注释按钮旁边的向下箭头。
调整选择,以便只标记“出现次数”。
Now, when you click on an item to highlight it, you can skip forwards and backwards to other occurrences using Ctrl+(comma)and Ctrl+(period).
现在,当您单击一个项目以突出显示它时,您可以使用Ctrl+(comma)和Ctrl+向前和向后跳过其他事件(period)。
回答by Arun PB
If you are looking to navigate through variables / methods defined in the same class, a quicker way to do this would be to select ( highlight ) the variable / method name you want to navigate to and use Alt+ Shift+ Rto get into the refactoring mode and then use Tabor Shift+ Tab.
如果您正在寻找通过在同一个类中定义的变量/方法导航,更快的方式做到这一点是选择(高亮)要导航和使用变量/方法名Alt+ Shift+R就可以进入重构模式然后使用Tab或Shift+ Tab。
Tab- takes you to the next occurrence
Shift+ Tab- takes you to the previous occurrence
Tab- 带你到下一个事件
Shift+ Tab- 带你到上一个事件
This way will save you from reaching mere text matches ( including those in comments ), as how Ctrl+ Kbehaves. So you are taken through only "valid" occurrences.
这种方式将使您免于达到纯粹的文本匹配(包括评论中的那些),就像Ctrl+ 的K行为方式一样。因此,您只会遇到“有效”的情况。
回答by Marian Pa?dzioch
Use Ctrl+>or Ctrl+<
使用Ctrl+>或Ctrl+<
and it's quite easy to remember because ><works as arrow pointing in the direction where you navigate.
它很容易记住,因为它><可以作为指向您导航方向的箭头。