Few weeks ago I was taking part in recruitment process. During technical part I was asked to enable Presentation Assistant https://plugins.jetbrains.com/plugin/7345-presentation-assistant which shows used keyboard shortcuts. I thought that this is good scenario for short blog post.
Today, I will show you my most used 10 Android studio keyboard shortcuts (and probably any IDE from JetBrains). I will split my list in two parts, from my point of view, more basic ones and more advanced ones. Ordering is random. Shortcuts are from macOS keymap.
Switching between declaration and usage. Pretty self-explanatory.
If we know class name, just hit command, type class name and enter. The same goes with file, which can be performed via doing the same command and clicking tab button. So we don’t have to remember another shortcut.
As I work in customized Android Studio interface, I like to work without any tabs, only one file opened at a time. So I don’t have any tabs to click on. Changing files via keyboard is the only way to go.
Remove unused imports. Don’t clutter your file with redundant lines.
If we agreed in our team on code style, we should follow it. It can also be done when doing commit via UI but I like to keep my code formatted properly all the time – it’s more readable for me.
To see who, when and what committed. This is my custom shortcut.
Making code pieces reusable and small with single responsibility.
While doing review, checking line in Pull Request and going straight to exact line in code.
For example, I don’t remember how some Fragment is called but I do remember string that is used there.
Really helpful when doing changes in Gradle files, fast shortcut to show actions popup, type ‘sync gradle’ and hit enter – done 🙂
This is my personal list of keyboard shortcuts i cannot live without during development in Android Studio. Must have for me! If you have any custom shortcuts like me, I will suggest exporting your config from Android Studio 🙂