IntelliJ IDEA keyboard combinations

Last Updated on by

Post summary: Some very useful keyboard combinations when working with IntelliJ IDEA.

IntelliJ IDEA is pretty good Java IDE. They provide community edition which is free and can suit perfectly your needs as an automation QA. This post described important keyboard combinations that can make you more productive. This post is for IntelliJ IDEA v14 Community Edition.

Original video

This post is inspired by video IntelliJ IDEA Tips and Tricks from JavaZone. I watched the video and realised how much you can achieve only with keyboard combinations.

I suggest you watch the video and take notes. I have taken important things from the presentation and put them into current post. It is much more easier to read rather than scrolling the video back and forth.

Presentation Assistant plugin

This plugin outputs the keyboard combination of action you perform. You can select something from the menu and it shows the keyboard short cut for this action. Very handy tool if your purpose is to learn how to do things only with keyboard. How to install it is shown on 02:50 minute from video.

Search

  • Ctrl + N – search and open types, search by camel case letters is possible, wildcards supported, :40 leads to line 40.
  • Ctrl + Shift + N – search and open files, search for folder is possible with / in front, wildcards supported, :40 leads to line 40.
  • Ctrl + Shift + Alt + N – search for symbol, filter by namespace is possible with dot.
  • Shift, Shift – search everywhere, TAB changes the result cluster, left arrow key gives history, right arrow key moves forward, by default recent files are shown.
  • Ctrl + Shift + A – looks up an action.

Navigation

  • Ctrl + E – recent files, search is possible.
  • Ctrl + Shift + E – recent edited files, search is possible.
  • Alt + 1 – open/close projects window.
  • Ctrl + Shift + F12 – hide/show all windows.
  • Ctrl + H – type hierarchy.
  • Ctrl + Alt + H – method hierarchy.
  • Ctrl + F12 – show class structure with methods.
  • Alt + 7 – open/close structure window.
  • Alt + F12 – shows terminal (cmd)
  • Alt + Home – jump to Navigation Bar (it should be enabled from View -> Navigation Bar). From Navigation Bar you can use keyboard arrows to navigate through packages.
  • Ctrl + Alt + S – opens settings.
  • Click on a module + F4 – opens module settings.
  • Ctrl + ` – shows quick menu to customise layout.

Code browsing

  • Alt + F7 – find usages.
  • Ctrl + B – go to declaration.
  • Ctrl + Alt + B – go to implementation.

Edit

  • Shift + Ctrl + L – auto format code.
  • Ctrl + W – selects word, then next, then line, then method, then class, then whole file.
  • Shift + Alt + Up/Down – move selected code or line on which cursor is up and down.
  • Ctrl + Y – delete line. This is massive non-sense in IntelliJ IDEA. All applications use Ctrl + Y to redo actions, here it deletes line, and when you then do Ctrl + Z – undo you get your self into real movie.
  • Ctrl + D – duplicate line.
  • Ctrl + C – copy.
  • Ctrl + V – paste.
  • Ctrl + Z – undo.
  • Ctrl + Shift + Z – redo.
  • Shift + F6 – rename class, method, field, variable, etc.
  • Ctrl + Shift + Alt + T – show complete re-factoring menu.
  • Alt + Insert – automatically generate getters, setters, toString, etc.
  • Alt + Enter – shows available actions that can be performed on given piece of code.
  • Alt + Enter -> Inject language or reference -> show nice editor for JSON for e.g.
  • Ctrl + P – get parameter info for a given method.
  • Ctrl + Shift + Space – smart completion, it can be invoked second time over the first completion.
  • Shift + Ctrl + Enter – complete current statement, insert semicolon.
  • Ctrl + Alt + V – extract variable from piece of code cursor is placed in.
  • Ctrl + Alt + T – opens predefined templates.

Debbuging

  • Ctrl + Shift + F8 – show all breakpoint, same is done with right click on breakpoint.
  • F10 – select a configuration to run.
  • Shift + F10 – run currently selected configuration.
  • F9 – select a configuration to debug.
  • Shift + F9 – debug selected configuration.
  • Ctrl + F2 – stop running application.
  • F7 – step into method in case of debug.
  • F8 – step over method in case of debug.
  • F9 – resume program in case of debug.
  • Ctrl + F9 – build code.
  • Alt + F8 – show evaluate window during debug.

Version Control

IntelliJ IDEA has very good Git plugin. You can do almost everything without installing additional visual Git client or without Git Bash.

  • Ctrl + K – commit changes.
  • Ctrl + T – pull changes.

Help

You can find complete keyboard references by IntelliJ IDEA Menu: Help -> Default Keymap References. This opend following PDF file IntelliJIDEA_ReferenceCard.pdf

Other source of information is: Help -> Productivity Guide

Conclusion

Being able to perform most of daily activities actions just with keyboard will increase your productivity so it is worth spending some time to teach yourself how to work with IntelliJ IDEA keyboard combinations.

If you find this post useful, please share it to reach more people. Sharing is caring!
Share on FacebookShare on LinkedInTweet about this on TwitterShare on Google+Email this to someone
Category: Java | Tags: