Is there a keyboard shortcut or how can I set up a keyboard shortcut in IntelliJ to either:
Or are their better ways to quickly navigate through code files with the keyboard?
IntelliJ is incredibly flexible with so many shortcuts it's hard to remember them all. I didn't find a current builtin solution for your first shortcut request: "1. Go up/down several lines at a time (e.g. 5 or 10)"
However, a macro can be created and mapped to a keyboard shortcut. Follow these steps:
Locate the newly created "D5" macro and double click it.
Add your desired keyboard mapping sequence. Be careful to find a shortcut not already in use. I went with Alt+Shift+5
"2. Jump up/down a method in a class"
To navigate or jump to the next method use Alt+Down (on OSX, Ctrl+Down), previous method Alt+Up (on OSX, Ctrl+Up - This is overridden on Mac by Mission Control and fixed by going to System Preferences > Keyboard > Shortcuts > Mission Control.)
"3. Go into a method hierarchy and then scroll up and down a method list"
To open the "Hierarchy Callers" Panel, while the cursor is on a method, press Crtl+Alt+h
Next select one of the "callers" or methods within the list to navigate to the call.
To navigate to the previous or next caller, press Crtl+Alt+Up or Crtl+Alt+Down
To show a list of methods in a class and navigate to a method, Crtl+F12 on Windows or ⌘+F12 on OS X
Other navigation shortcut I find useful:
To navigate to the beginning or end of a bracketed statement: Ctrl+[ and Ctrl+]
There many other shortcuts for navigation, selections and code edits. To learn more open the Keymap settings and explore.
Page Up and Page Down will scroll to show lines above or below the current visible code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With