Intellij Shortcuts that saved my life.
Developers are wonderful creatures. We tend to be the laziest bunch in the organization but when the deadline approaches then we turn into grand wizards, turning up with wonderful concoctions in record time. This sort of wizardry does come with experience and I am nowhere near experienced but learning IDE shortcuts do boost in productivity. So, I am listing out a bunch of shortcuts that I frequently find using.
Word of warning!! I mostly code in Java
or Kotlin
or a bit of Dart
using Intellij products. So, I will be mentioning shortcuts which helped me while working with these languages but I am sure that some of these shortcuts will be language agnostic.
Now, that I have made all the JavaScript coders leave the site with the warning, let us begin:
-
ctrl + shift + f
: This is the big daddy ofctrl + f
, which I also find using a lot. This command is used for finding all the usages of a particular expression in the codebase. I can also filter my search domain using this which also helps in codebases with proper packaging sequences. Best use with large code bases. -
alt + enter
: This is what helps lazy devs to be super productive. It has become kind of my habit to use this. Its used for solving errors, overriding methods, adding annotations, transforming code and some other code insertion operation. As you can see this writes code for you based on suggestions provided by Intellij and Intellij damn well gives great suggestion. I sometimes feel like not writing code on my own in some cases. If only it would give me enough suggestions to spice up my love life. Sigh. -
ctrl + space
: Another code completion shortcut. Great for naming variables. Can be used for some code block insertion but I mostly use it for naming variables. Sometimes you might end up with variable names such ashavanaOooNanaBananaId
but in most case it does a good job. -
ctrl + n
orctrl + shift + n
: This is pretty useful because I writeJava
code, particularly in theSpring
framework. So, I have a bunch of classes declared in files and also resources likeJSP
or scripts in my app folder. I usectrl + n
to navigate quickly to a class andctrl + shift + n
to navigate to any file the app folder. -
shift + F6
: This is a good one for most devs. I use this to mostly refactor code and trust me you will need to refactor code, big monster codes. This command is particularly helpful to change a method, class or variable names and also all the changed entities’ usages too, while maintaining scopes for variables and accessibility. It also changes the accessor and mutators when instance variables are changed in any class.
So, the above are top 5 shortcuts I find myself using a lot. I must have missed something but that’s cause I don’t usually use them but would love to know from the comment section.