A quick guide to using keyboard shortcuts for programmers

keyboard shortcuts for programmers

Using keyboard shortcuts reduces the time spent performing actions while using our computer. This guide to using keyboard shortcuts for programmers will highlight the advantages in using them to increase our efficiency.

As programmers, we tend to require use of multiple software tools and applications to perform our tasks. Your operating system, text editor and web browser are examples of environments you’re frequently switching between. Taking the time to learn keyboard shortcuts of actions you perform often is an easy way to increase your productivity flow.

Why you should use keyboard shortcuts

To improve productivity

I define an ideal work state as when I’m able to focus on my primary task with minimal interruptions. Using keyboard shortcuts to perform actions and switch between tools helps while I’m in this state.

If you aren’t aware of keyboard shortcuts or just never invested the time learning a few, the time is now to get familiar! It will really change how you use computers for the better.

Think about it.

When your fingers are already on the keyboard, pressing key combinations is usually faster than dragging a mouse to the designated area on screen, then going through a series of clicks to perform the action.

If we take a simple example like opening your file manager. If you weren’t using a keyboard shortcut, you’ll first have to drag your pointer to the application launcher menu (or equivalent), then drag the mouse once again to click on the relevant icon to launch your file manager.

using mouse to open files
Using a mouse is such a drag isn't it?

Compare this to just pressing a 2-key or 3-key combination that will immediately launch the application.

keyboard shorcut to open files
Using keyboard shortcut to open file manager in a blink of an eye! Key combination for this on both Windows and Linux (Ubuntu) is [windows logo key + E ].

Using keyboard shortcuts to navigate more quickly around your operating system environment is just one way you should make use of it.

To master your tools

While coding we do so on a text editor or IDE (Integrated Development Environment). Such editors tend to have a set of keyboard shortcuts which you can use to perform most actions available in the menus.

We tend to jump across different editors as developers. Whether it’s between visual studio code, eclipse, android studio and many more. An advantage of using keyboard shortcuts for each of these tools is actually being able to use certain functionality more easily. Some functions can be hidden behind menus that are buried deep within the editor. You’re going to find yourself using these functions less if you have to constantly reach for your mouse to select them. However, you’ll be missing out as a lot of these functions will help with your efficiency while coding.

Taking the time to learn keyboard shortcuts will open up functionality that you can use to improve your productivity.  By doing this you are essentially becoming a master of your tools.

You might think, why bother learning the different keyboard shortcuts for each editor you use? Especially if you find it cumbersome having to learn a bunch of different key combinations.

But trust me, the initial extra time spent getting familiar with keyboard shortcuts will be worth it in the end. Even learning just one or two of your most used actions will help. In my opinion, it also makes your work a lot more enjoyable since less time is spent dragging and clicking to perform repetitive actions.

Now that we’ve established why using keyboard shortcuts is necessary, let’s talk through some tips and tricks around using keyboard shortcuts for programmers.

master your tools. use keyboard shortcuts for programmers

Tip 1: Include all tools

Although you spend a lot of time on your editors and IDE’s which is where the actual code is written, think of other tools you frequently use.

Any environment you use to enable you to write the code you need is all part of the development process. 

Think of repetitive actions you carry out on your computer while developing. This can include your operating system, web browser, mail client, command line and so on. Any action you do regularly might be worth spending a bit of time learning the keyboard shortcut for it.

Some regular tasks I find myself doing other than where my code is written include navigating through file managers, accessing the desktop, opening a web browser tab. There’s also the action of frequently switching through these various environments as effortlessly as possible. I perform these so often that the keyboard shortcuts are practically embedded in my muscle memory!

For you, think of actions you do as part of your development tasks. Once you realise what these are, learn the shortcut and start using them. You’ll soon wonder how you ever had the patience doing things the old way!

Tip 2: Don't overwhelm yourself

Be selective in which keyboard shortcuts you learn.

Each tool you use could have over a hundred mapped key combinations for use as shortcuts. You’re hardly going to memorise all of them.

How I know the ones to learn is to simply use the tool for some time and pay attention to actions I find myself performing regularly.

For example, let’s say I’m coding in Python, which is a language with an indent sensitive syntax. It can be quite bothersome to correct multiple lines of indentation when it’s not correct. As I’ll have to place my cursor on each line, and press tab or space to align it properly.

In this case I realise while coding in Python I need to indent regularly. So what I do is look up keyboard shortcuts to do this on visual studio code, the editor I’m using. A quick search tells me the key combination for this is Ctrl K, Ctrl F.

I highlight all lines I wish to fix the indentation, press the key combination and it works. Great.That’s going to save me a lot of time!

Since I use that feature a lot, learning that one shortcut has already improved my efficiency. So what I advise is to pay attention to actions you perform regularly, then learn the keyboard shortcut for it.

However, I also advise against spending too much time memorising too many shortcuts. For an IDE, I like to keep the number of shortcuts I memorise to around 15 to 20. As I get better at effortlessly using these shortcuts over time I can then choose to learn some more.

For other tools I might use occasionally, I’d only memorise shortcuts for actions I use nearly all the time. If I forget, I can look it up quickly and use it during the short time I’m using that tool.

Also don’t waste energy learning unnecessary shortcuts you only use a few times.This includes shortcuts such as settings you’re probably going to set once and forget. For example, there’s little point memorising how to change the editor theme if you never change it.

Tip 3: Manage your keyboard shortcuts

These are little things you can do to improve how you make use of using keyboard shortcuts to your own preference.

Customising your key combinations

 There are cases when actions you perform aren’t already mapped by the application. In this case, there may be options to to map your own key combinations and make the action a shortcut.
 

As an example I use the Linux KDE desktop, which provides a list of shortcuts the user can map their own keys to. A lot of these don’t have default key bindings so it’s up to the user to do so.

You may also remap a keyboard shortcut already assigned by the application if you wish. I personally avoid doing this because if I don’t use the tool for a while and later re-install it I’ll have to remap it again. 

By learning the default mapped keys, it also means I can use the default shortcut when for example, editing on someone else’s PC (assuming they are also using the defaults).  It also works out because if i forget how to use the shortcut a quick search will remind me.

Make your own list of shortcuts

If lists are your thing, you can do up a list of tools and software you use and your frequently used key combinations. This way, when you return to it after a long time of not using it you can just refer to your list to quickly recall the most used ones.
 

It’s important this list isn’t too long. Maybe try to keep it  your top 3 or 5 most used shortcuts for each tool. If you have a list of let’s say 30 shortcuts for each tool, when you refer back to that list, you might get frustrated at having to memorise all that again!

You may even bookmark websites with lists such as top keyboard shortcuts for programmers when using a specific application. Or bookmark pages on the applications website that lists the keyboard shortcuts so you have a way to refer back to.

Conclusion

Hope you learnt some useful tips in this guide on using keyboard shortcuts for programmers.

Just to add, don’t be too hard on yourself on memorising every useful shortcut you come across. I sometimes find myself forgetting ones I tried to memorise and end up having to refer back to my own list. But it’s worth doing this and eventually you should develop some muscle memory for your most frequent actions.

Finally, although this is a guide to keyboard shortcuts for programmers, it can certainly be applied to anyone who uses software applications and tools to do their work.

As always, comments are welcome below!

If you want more tips on programming, check out 5 ways to help you practice coding.