I learnt how to work with my intelliJ / Android Studio without using my mouse and what I most like is that I spend less time executing the actions that I need, like refactoring, managing files, etc and I am more focus in what is really important, the code.
Don’t let yourself get distracted
What do you prefer a clean and minimalistic desk without nothing to get distracted or a desk full of papers, cables and other stuff? It’s not me, as you can see there are many articles on the internet talking about why decreases the stress. If you don’t use something, just clean it. So, I try to apply this to my IDE. The first thing that I find useless are the tabs. I don’t need tabs because I find is horrible to navigate between them, as soon as you start navigating between files in a project you get plenty of them and you get lost. So, Is there any other solution to navigate? There are some Alternatives like:
So now, that we have a way to navigate between files, we can remove the tabs. To do that, we can go to: Settings> Editor> General> Editor tabs> Placement none.
Another thing that we can get rid of is the menus at the sides, by pressing the following button at the bottom left of the IDE:
And then we can access again the side menus with the keyboard:
With that configuration our IDE becomes cleaner, something like this:
If you want to keep it minimal you can activate the distraction free mode: View> Enter distraction free mode>. This mode is my preferred way to work, is relaxing because you get rid of most of the useless buttons of the IDE.
I don’t know how to get rid of the main bar menu, but that will be awesome 🙂 I think other OS like OSX and Windows the behaviour of the distraction mode is different, so if in your computer does not look exactly the same, that would be the reason.
Obviously, we need to know how to perform most of the common actions with the keyboard. If we get lost anytime don’t use the mouse! Use the actions shortcut:
|Short desc||Shortcut||Long desc|
Ctrl + ⇧ + A
⌘ + ⇧ + A
|Shows a dialog where you can search actions of the IDE, so for example if you want to debug and you forgot the shortcut, just type debug|
This is the first shortcut you should learn, and after that this is a relation of the most common one or at least that ones that come to my mind in my current workflow:
Another essential tool for my toolbox is the live templates which I find particularly useful to not have to write loops. Why would you type tedious index based loops yourself when you can do so just by typing “fori” and just fill the gaps, the same thing goes for iteration loops which can be shortened up by just typing “iter”.
The menu to check and create live templates can be found under Settings > Editor> Live templates
Postfix Code Completion
Let’s conclude the article with the cherry on the cake, postfix code completion. Postfix code completion will further boost your productivity by transforming an expression to another one based on the postfix applied and the context of the expression. Two of my favourite ones for boolean expressions are “.not” and .if” which will negate and wrap the expression as we go. Another two which are also really useful are “.null” and “.notnull checks the expression for null and not null respectively.
The list of all postfix completions can be found at Settings > Editor> General> Postfix Templates but I’ll include a screenshot so you can quickly have a look at them. Also, note that postfix completion suggestions are part of the basic completion, so we can easily autocomplete them and save a few extra types. To check all the possible postfix completions available in the current caret context, use Ctrl + J (⌘ + J for OS X).
Do you type fast enough?
You are using your keyboard for many years I’m pretty sure about that, but, do you know how to use it properly? I’m at that point that I realised that I’m not using enough fingers, is not that I don’t type fast, is just that I can type faster if I practice and I learn the basics of how to touch typing. To do that I proposed to myself practice during 30 min every day. To test my progress I discovered: Type racer a simple game to practice and also measure your current words per minute (wpm).
A good keyboard is something that can help you to type faster. I bought a mechanical keyboard some time ago and I’m getting used not only to the mechanical keys also to the layout of that keyboard. To be more comfortable with my keyboard I switched some keycaps, is my tool and I really love to have something that looks nice! I discovered also that I feel more comfortable using Cherry MX brown switches to type. This is a photo of my current keyboard setup:
My filco keyboard now looks properly :)) pic.twitter.com/uE5HGttJm1
— Christian Panadero (@PaNaVTEC) 15 de marzo de 2016
I spend many hours writing code, is necessary for me to have a good-looking desk/OS and be comfortable with all the tools that I use, as well as the carpenter knows how to handle the hammer, you as a developer need to know how to use your tools properly and know them as the palm of your hand.