How to Navigate quickly to the next variable occurance [message #124710] |
Thu, 04 December 2003 19:58  |
Eclipse User |
|
|
|
Hi,
Is there a shortcut key / plugin / whatever I can use to let me highlight
a variable and move quickly to the next reference to it within a Java
file.
Right now, the only option I see is to right-click->Search->Occurances in
File, and then click on the up/down arrows. This is labourious for
something I want to do so often when scanning over code.
Any help would be much appreciated. If there's no easy way to do this I'll
look into writing a plugin... :)
Alex
|
|
|
Re: How to Navigate quickly to the next variable occurance [message #124830 is a reply to message #124710] |
Fri, 05 December 2003 04:27   |
Eclipse User |
|
|
|
Originally posted by: eclipse.tkilla.ch
> Is there a shortcut key / plugin / whatever I can use to let me highlight
> a variable and move quickly to the next reference to it within a Java
> file.
Two ways to achieve this:
1. Poor man's textual version, will also jump to comments containing the
same identifier...
a) Select the variable (I mean: textually select the entire identifier)
b) Use Ctrl+K / Ctrl+Shift+K (or whatever your keybindings are) to jump
forward and backward. This will highlight any text that
2. Da real thing (AST based)
a) In the preferences, enable Java->Work in Progress->Show Occurrences
b) In the preferences, go to Java->Editor->Annotations, enable
"Highlight" for search annotations (this just helps visually, but is not
required)
c) In the workbench, note the Go to Next arrow in the global toolbar; in
its dropdown box, you can select the targets that Go to Next (bound to
Ctrl+. till now, the keybindings are changing, however) and Go to
Previous will jump to. Enable Search results as targets.
Now, whenever you place the caret on a variable, or other identifier, it
will get highlighted and all its occurrences with it. Use Next/Previous
to iterate them.
HTH, tom
|
|
|
Re: How to Navigate quickly to the next variable occurance [message #124854 is a reply to message #124830] |
Fri, 05 December 2003 04:41  |
Eclipse User |
|
|
|
Originally posted by: hcs33.egon.gyaloglo.hu
Hi,
Some additional idea (3.): if you want to use this feature rarely, you can
use Ctrl+Shift+U (or in menu: Search-->Occurences in File) to highlight the
occurences of a variable the cursor is in. In this case the search view will
open and you can use Go to Next and Go to Previous for search next/previous
occurences. When finish, simply press F12 (Activate editor action) to go
back to the editor.
HTH,
Regards,
Csaba
"Tom Eicher" <eclipse@tkilla.ch> wrote in message
news:bqpitd$mud$1@eclipse.org...
> > Is there a shortcut key / plugin / whatever I can use to let me
highlight
> > a variable and move quickly to the next reference to it within a Java
> > file.
>
> Two ways to achieve this:
>
> 1. Poor man's textual version, will also jump to comments containing the
> same identifier...
> a) Select the variable (I mean: textually select the entire identifier)
> b) Use Ctrl+K / Ctrl+Shift+K (or whatever your keybindings are) to jump
> forward and backward. This will highlight any text that
>
> 2. Da real thing (AST based)
> a) In the preferences, enable Java->Work in Progress->Show Occurrences
> b) In the preferences, go to Java->Editor->Annotations, enable
> "Highlight" for search annotations (this just helps visually, but is not
> required)
> c) In the workbench, note the Go to Next arrow in the global toolbar; in
> its dropdown box, you can select the targets that Go to Next (bound to
> Ctrl+. till now, the keybindings are changing, however) and Go to
> Previous will jump to. Enable Search results as targets.
>
> Now, whenever you place the caret on a variable, or other identifier, it
> will get highlighted and all its occurrences with it. Use Next/Previous
> to iterate them.
>
> HTH, tom
>
|
|
|
Powered by
FUDForum. Page generated in 0.68426 seconds