This article helps software developers to boost development productivity in their IDE. It presents many keyboard shortcuts and functionalities you don’t know about yet. Although the examples are tailored to the PyCharm IDE, you will learn the methodology for discovering and adopting shortcuts for any tool. I will demonstrate how to effectively create your own cheat sheet, and why this is better than just using other people’s cheat sheets. The application of your gained knowledge to other tools and programs will make you even more productive.
If you’re a developer you’ll probably make heavy use keyboard shortcuts in your IDE or editor. But do you really use them to your full advantage? It turns out that this is often not the case. In fact, there are many more shortcuts and tricks you are probably not aware of. Join me on a fun journey full of productivity tips that will boost your efficiency. I’ll demonstrate everything with the PyCharm IDE made by JetBrains, but the concepts apply to other IDEs, and even to other software tools.
To demonstrate how keyboard shortcuts can boost your efficiency, let’s consider two simple examples. In each example, the first video (left) uses the long and complicated way, without shortcuts (or only the traditional ones, like Copy-and-paste). The second video (right) then uses the shortcut.
The first example demonstrates how to wrap a code block,
await loop.sendfile(...), into a try/catch block:
The second example shows how to change the order of statements, moving up the statement
As you can see, the benefits are significant. You’ll need much fewer keystrokes, and you won’t lose time switching back and forth between keyboard and mouse to make selections.
Useful efficient shortcuts by category
There are many, many functions that can be triggered by shortcuts. This section will list 36 shortcuts I personally found useful, organized by category. They are not specific to any IDE or keys. Thus, it’s still your job to find out whether these functionalities exist in your IDE, and whether they can be accessed via shortcuts. If you use PyCharm (or another JetBrains IDE), I’ve added the name PyCharm uses to describe the functionality, in parenthesis.
If you still want to go on, or want to compare your findings with mine, click on the titles to expand the corresponding section.
Three general tips for building shortcuts
- The shortcuts presented above are just a glimpse of what’s possible. You really need to go through your IDE’s keyboard mappings dialog and investigate all the available functions. I would never have discovered tricks like “Copy as plain text” or “Embed into try/catch” otherwise. Sure, the list has hundreds of options, which is daunting at first. You’ll have to spend 1-2 hours to make it through. However, once you have discovered the first few shortcuts, you’ll become really motivated and time will fly by – I promise! You’ll feel like a gold digger who keeps finding nuggets.
- Find ways to synchronize and remotely save your keyboard mappings, e.g. to a file. You put a lot of effort into customizing those shortcuts, so you better not lose this work by accident. Also, if you work on multiple machines, you’ll want the shortcuts to be the same everywhere. The mechanisms vary for each program. The PyCharm IDE, for instance, has several synchronization options. However, beware of bugs in that functionality. The JetBrains products are great in all respects, but they messed up settings synchronization, and haven’t fixed bugs in a long time. I recommend you use the synchronization via a Git repository, as this will allow you to revert data loss caused by the IDE.
- Assign sensible keys when creating new shortcuts. For instance, use the first letter of the keyword that comes to your mind when you think about the functionality – e.g.
Pto show the list of parameters of a function. Another trick is to augment existing shortcuts you already know by adding modifier keys (like ALT, Shift, etc.). For instance, if
CTRL+Cis copy selection, then copy selection as plain text should be similar, e.g.
How to adopt keyboard shortcuts
There are way too many shortcuts to remember. Even though you may remember that there is a shortcut for the functionality you want to use, you need an efficient way to look it up. If looking it up took you longer than just doing things manually, you wouldn’t have gained anything.
My suggestion is that you create your own cheat. I’m using the following approach:
Create cheat sheet document
Create a new, empty cheat sheet with your favorite word processor or spreadsheet editor. Go through all available shortcuts in your IDE. Write down an unstructured list of all short cuts, in random order. You only need two columns, one for the shortcut’s keys combination, one for the description of the functionality. Use your own words to describe it, using keywords you’d use when searching for it. If in doubt, use several keywords.
Optional: group shortcuts by category
When you group your unordered shortcuts by category, you’ll have a higher chance of remembering which shortcuts exist. It will also improve the readability in case you study your cheat sheet and it may help you think of even more commands to find keyboard shortcuts for.
Facilitate access to your cheat sheet
Make your cheat sheet as easily accessible as possible, e.g. by creating a link in your task bar (Windows) or dock (macOS). You can also create a keyboard shortcut that opens the cheat sheet.
Whenever you work in your IDE and need to look up a shortcut, open the cheat sheet and use the editor’s search functionality to find the shortcut. This is much more efficient than manually looking through all cheat sheet entries, and it also beats using the IDE’s integrated shortcut search, which wouldn’t find things for your keywords.
You’ll realize that your cheat sheet is a living document. Over time, you’ll be updating the descriptions of the functionality, optimizing the keywords you use when searching for them. You’ll also update the keys of the shortcuts occasionally, e.g. if a combo is too hard to press, or if you found more logical key combinations.
What I just described is the on-demand adoption of shortcuts. You can also adopt them via deliberate practice. My approach is to print out my cheat sheet, but hiding the key combination column. With the IDE ready, I randomly select a shortcut with my fingers and try to execute the command as fast as possible.
About those pretty cheat sheets from the Internet
You are probably familiar with cheat sheets other people put on the Internet. They use pretty colors and fonts, neatly laying everything out on a single page. Inspired by those, I actually created such a cheat sheet myself, shown in the image below. However, I found that such pretty single-page cheat sheets are a bad idea, and I will never make or download such cheat sheets ever again. Here are the three reasons, why:
- They are hard to edit
- They are often in PDF, which is not meant for editing!
- The layout will break immediately once you add or remove entries, or change the wording!
- They are not meant for you
- The items on a cheat sheet are those that the author found helpful for herself. Your interests might be entirely different from those of the author!
- The wording that describes the shortcut’s functionality might not work for you. You might not find things easily!
- No reflection or motivation to use them
- No matter what kind of cheat sheet this is, it’s not just about the result, but also about the work that goes into it. It’s like reading an entire book vs. reading just a three-page summary: you’ll know much more after reading the former, having reflected the content.
- You’re much more likely to remember and use shortcuts (and the related functionality) that you discovered yourself. You are connected to those discoveries emotionally. You will be motivated to use them, as this is the pay-off for the work you did before.
Now, my cheat sheets are just regular spreadsheets, where I can move rows and columns around quickly and find things efficiently using the search function. Tip: if you want to do a fuzzy search, find out whether your editor supports “wildcard search”. For instance, Microsoft Word or LibreOffice editors support wildcards in the “Find and replace” dialog. Consequently, a search for “rename*method” (using * instead of space) will find entries such as “Rename variable/method”.
Beyond shortcuts: Learn your tools
Another tip to boost your productivity is to examine your IDE more closely. It probably has a lot of features you might not need a shortcut for, but still want to access from time to time. Go through the menu structures and dialogs, study the manual, or search the Internet for productivity tips related to your IDE.
Additionally, chances are high that your IDE is extensible by add-ons / plug-ins. So make sure to check out which popular plug-ins exist and how they can make your life easier.
For PyCharm, I found many useful features, such as the integrated HTTP REST client, or the ability to create and update copyright notices, which is very useful for open source projects whose licenses require such notices in every file. I also found great plugins such as a PlantUML integration, mind mapping, grammar checking or JSON parsing. There is even a plug-in that reminds you to use shortcuts.
The key to boosting your software development productivity is to explore the features of your IDE. Assign and adopt shortcuts to get the many little things done faster than ever before.
Most importantly, this process can be applied to any tool or program you use regularly, e.g. a word processor, video editing software, browser-based software (e.g. WordPress), the Linux shell, or those command-line tools like Git or Docker which you might use. In the best case, you can even change shortcuts so that the same key combinations will trigger a specific functionality in every software.