Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jump to beginning/end of block in Eclipse

First off, I'm not looking for CTRL+SHIFT+P, but something a little more flexible. Is there any way to jump from anywhere inside a block to the beginning or end of that block?

like image 939
Brad Mace Avatar asked Aug 08 '14 16:08

Brad Mace


People also ask

What is Ctrl Shift G in Eclipse?

Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.

What is Ctrl Shift L in Eclipse?

2. 3. Quick Search became part of the Eclipse platform some time ago. It can be found in Search > Quick Search and the default key is Ctrl+Alt+Shift+L.

What does Ctrl k do in Eclipse?

In Eclipse, if the cursor is over a word and you press Ctrl + K you will jump to the next occurrence of that word in the file.


2 Answers

CTRL + SHIFT + UP works and takes you to the beginning of the function. If you repeat it again takes you to the next function in the upward direction. CTRL + SHIFT + DOWN takes you to function names in DOWNWARD direction.

I tried in Version: Mars.1 Release (4.5.1)

like image 69
Paresh Pednekar Avatar answered Oct 19 '22 07:10

Paresh Pednekar


I'm afraid the command you are looking for does not exist in vanilla Eclipse.

You can try Shift+Alt+↑ , which will select the enclosing element. It should eventually select to whole block. ←  then moves the cursor to the beginning, →  moves it to the end.

But it really isn't any faster than:

  1. End to jump to the end of the line
  2. Ctrl+Shift+P to go to end of the block
  3. Ctrl+Shift+P again to go to start of the block

If your code is somewhat reasonably formatted (i.e. not everything on one line), this should always work.

Also check the list of possible shortcuts in Preferences->General->Keys, there isn't one that does what you want.

like image 27
jmiserez Avatar answered Oct 19 '22 05:10

jmiserez