You don’t have to be one of those people who find the idea of using a trackpad repulsive and curse Steve Jobs for popularizing the GUI. Ultimately, the choice is yours on how diehard you want to get with SCs. This is a stone-cold fact if you don’t believe it, check this footnote.² Every second spent learning an SC will yield hours of time in the future. If there’s one thing I want you to take away from this article, it’s this. Since, after all, this is an article on shortcuts, we’ll abbreviate it as SC going forward. I know that this is a deeply un-sexy term, but you know what is sexy? Having more time to do stuff that’s not repetitive. What are the magic tools that allow us to do this, you ask? Answer: keyboard shortcuts. In our imaginary file, there would be so much repetition of those micro-activities that we would be monsters if we didn’t at least try to DRY them out. ![]() You would also see a ton of micro-activities, such as switching between applications or opening a browser window. ![]() There would be some big, headline activities that take up many lines, like writing code, surfing the web, writing emails, and listening to music. ![]() Let’s pretend for a second that every action you take on your computer in the course of a day were represented as a line of code in a file. You can apply it as big and abstract (going to college) or as small (organizing your sock drawer) as you want.¹ Specifically, we’re here to talk about a time investment that pays off with the thing that money can’t buy: more time. Here and now, let’s reclaim the original meaning of the phrase: that is, time spent doing something that will pay off in the future. If you want to organize the imports use Ctrl+Alt+O, to execute all the formatting features just use Ctrl+Shift+Alt+T.Īlso read: Know your IDE: IntelliJ IDEA (part 2) – Navigate Through the Project With Use of Keyboard.When people use the phrase time investment these days, they often mean time suck, as in, “I’d always wanted to rewatch the ‘Lord of the Rings’ movies but it’s such a time investment. If you have a problem with organisation of the code you can use Ctrl+Alt+L to format the code. Formating and cleaningįormatting and cleaning. Instead of creating manually test classes you can use the shortcut Ctrl+Shift+T. Instead of using search-replace – focus cursor on variable/constant/class/method and press Shift+F6. If you need to edit multiple lines use Ctrl+Ctrl(hold)+Arrow. Why write them multiple times? Write the code once and use Ctrl+d to duplicate it. Sometimes you need to write multiple similar lines and pass different parameters. Just use Ctrl+W to expand the selection, or Ctrl+Shift+W to narrow. Magic selectionĭid you know that you don’t need to manually select the strings, or some grouped parts of the code by a mouse, or arrows? There is a quite simple shortcut to select string, method name, field name or any other part of the code. Similary you can do this for focused value to extract it to variable using Ctrl+Alt+V, or to constant using Ctrl+Alt+C. To extract some part of the code to method – use Ctrl+Alt+M. ![]() Code generationĭo you want to get rid of manual implementation of constructors, getters, setters, toString, equals and hashCode? You can use automatic generation of the code – Alt+Insert. Intellij IDEA keyboard shortcuts: table of contentsĭo you have some red (or yellow) underlined parts in the code? Focus cursor on one of them and press Alt+Enter and see IDE’s suggestions how to fix the issue. In the future, I will provide you some keyboard shortcuts to navigate through projects. It led me to the idea of writing a series of blog posts about some interesting functionalities/plugins that Intellij Idea provides. Become the Chopin of your keyboard.ĭuring pair coding with my fellow Java developers, I’ve noticed that some of them are not familiar with some useful features of IDE.
0 Comments
Leave a Reply. |