Anyone who uses a computer for a significant amount of time each day should spend some time learning keyboard shortcuts - they can save you so much time!
When I started working as a developer, I learnt keyboard shortcuts through pair programming, asking more experienced programmers what their favourite shortcuts were, and just reading documentation for the IDE (Intelligent Development Editor) I was using (VisualStudio with Resharper at the time, now IntelliJ.)
Here are my most used keyboard shortcuts, starting with the basics:
Global
These shortcuts are absolute essentials and work in most apps (text editors, browsers, email clients, IDEs, etc.) If you don’t already use them, spend some time memorising and practising them. It’ll save you loads of time in the long run.
-
ctrl-v - copy
-
ctrl-x - cut
-
ctrl-v - paste
-
ctrl-z - undo
I’m on Linux, but these shortcuts work on Mac and Windows too (on Mac ctrl is replaced by command ⌘)
Ubuntu
- alt-tab - toggle between open applications
- plus use ↑ ↓ → ←to toggle between instances of an app
-
ctrl-shift-v - paste into the Ubuntu terminal
-
ctrl-R - reverse search commands in the Ubuntu terminal. I only learnt this one recently (thanks Rich!) and it’s been a game changer!
Browsers
These work in Chrome, Firefox and IE. Again I use these many many times each day.
-
ctrl-tab - jump between open tabs
-
ctrl-t - open a new tab
-
ctrl-w - close the current tab
- ctrl-shift-n - open an incognito window
IntelliJ
I’m kind of a JetBrains fan girl, not only because I love Kotlin but also because they make incredible IDEs. These shortcuts work in IntelliJ and all other JetBrains IDEs (Pycharm, WebStorm, etc.) These are roughly in order of how often I use them, but I use them all multiple times every hour!
- alt-enter - see and select suggested actions to fix an error or warning, improve or optimize the code
-
ctrl-alt-l - auto-format your code
-
ctrl-n/ctrl-shift-n - search for classes/files respectively
- once you have the search widget open, you can just type the first letter of each word in a class or file’s name
to find it. E.g. to find the
ModelRunController
class I typemrc
- once you have the search widget open, you can just type the first letter of each word in a class or file’s name
to find it. E.g. to find the
-
ctrl-w - highlight the current text with increasing scope. Note you might want to assign this one to a different key combo, since ctrl-w usually means “close window”. See below for how to assign shortcuts in IntelliJ.
- alt-f1 followed by enter - jump to the location of the current file in the project menu
- shift-f6 - rename a file
Customising shortcuts
You can customise your shortcuts on Ubuntu by going to settings -> devices -> keyboard. Similarly other OS shortcuts are customisable.
In IntelliJ there’s even a shortcut for customising shortcuts! ctrl-shift-a will allow you to search for an action. Once you find it, hit alt-enter to open an editing window. Then hit the keys you want to assign as a shortcut for that action.
For example, IntelliJ by default assigns ctrl-y to delete a line. This is unintuitive to me and I want ctrl-y to redo an action that was undone by ctrl-z.
This is a list of the shortcuts I estimate that I use the most on a daily basis. I’d love to hear which shortcuts other people find indispensable, maybe there are some great ones I’m missing!