Shortcuts, vi and Text Navigation on macOS
In my day job, part of my role is to act like a messaging queue — I need to relay, synthesize and distribute information as reliably, fast and efficiently as possible.
Since the degree to which I do this well has an impact on the performance and well-being of the entire team, I’ve made a conscious effort of using my Mac in a way that requires fewer keystrokes and less time.
What’s equally important: if done well, this is a more fun and less stressful way of getting things done. So, in a way, I can have my cake and eat it too.
Sounds strange? It isn’t: by optimizing my workflows for keeping my hands on my keyboard most of the time, I increase tactility and speed. Both of which increase the fun I’m having while working on my Mac.
Let’s look at tactility first: it feels a lot more satisfying to press a key than to click a mouse button. Think about the old-school physical buttons on older trams or subway cars, where you physically pressed a button, versus the newer ones. These do not physically react to your button press — instead, they are just a flat surface which lights up upon being pressed. Human comfort comes from how much we can influence our environment. Tactility is a small feedback mechanism that provides just that. A keyboard provides more tactility than a mouse. And if increased tactility is a more pleasant feedback mechanism, it follows that we should optimize for more tactility, so more interaction with the keyboard than the mouse.
Regarding speed, there’s a cost in the attention of physically switching your hands from your keyboard while typing something to your mouse to interact with the UI and then back again. It simply decreases focus to realign your hands, parse where the mouse cursor currently is and get it where you want it to be. Now, conscious breaks of screen time are great, but it should be your choice when and how to do them and not something that’s mandated by your workflow.
Additionally, staying on the keyboard is just a lot faster. Since I spent most of my work day in front of a computer, little differences in speed for each interaction quickly add up to significant differences over a day, a week, or a month. Simple example: switching tabs using
cmd + tab no versus using your mouse to do that. Since one hand is already positioned to press the keyboard combination, it takes approximately 700ms from start to finish to execute what I wanted to do. When using the mouse, even if the other hand is on the mouse, I need to move it up to the tab bar, hover over the correct tab and then click to select — and then move the mouse back into the browser window. Not only is this less tactile, but it’s also plainly more complicated of an interaction (so, more error-prone) and it’s almost twice as slow.
Hence, the goal of this post is to outline how you can systematically increase your I/O ratio, meaning what you get done on a Mac vs. how much time and effort you spend.
I’ve split this up into three sections. Each section touches on a couple of concepts, listed below:
- Increase tactility
- Shortcuts and how to learn them
- Keyboard-driven navigation
- vi keybindings
- Write more while typing less
- Text expansion
- Code snippets
- Symbols expansion
- Type faster
- Touch typing
- Alternative keyboard layouts
- EN locale
- A primer into keyboards
Application Shortcuts and How to Learn Them
Well-made apps and operating systems offer a plethora of keyboard combinations. I’ll list some of the most useful ones and then expand on how you can easily pick up more of them.
Tab Navigation (works in All Major Browsers and Most Other Apps Which Offer Tabs, e.g. macOS finder)
cmd + topens a new tab
cmd + wcloses a tab
cmd + shift + treopens the last closed tab (this can be repeated to reopen multiple previously closed tabs)
cmd + tab no.navigates to a given tab. This is not zero-indexed, so to navigate to the first tab press
cmd + 1
cmd + clickopens a link in a new tab instead of the current one
cmd + kopens up the channel switcher
cmd + shift + aopens all unread messages
up arrowedits your last message in a given chat
cmd + \hides the UI (especially useful during screen sharing)
cmd + /opens the command palette (would love to have this at
cmd + kas in most other apps)
odraws a circle (remember with “oval”)
rdraws a rectangle
- …and so on — Figma shortcuts are super semantic, one of the many things they’ve got right
Rather than trying to have a comprehensive list here, let’s go over how can you learn the most relevant keyboard shortcuts for the applications you use most.
One helpful application for displaying all available shortcuts for the currently opened application is CheatSheet. Beware that this works best when using native macOS apps and only so-so for Electron apps (like Slack).
Another option is using Raycast and its
Search Menu Items command (which also has a shortcut on its own,
cmd + m). This will list all menu items and their shortcuts in a list, which you can quickly filter by typing what command you’re looking for. This also works best in native apps. If you don’t want to use Raycast, you can use macOS’s built-in shortcut to search menu items,
cmd + shift + ?.
Some non-native apps, like Slack or Todoist, offer a dedicated overview of supported shortcuts. You can open it in Slack via
cmd + / for example. In Todoist, pressing
? will do the trick.
The general rule of thumb for me is: whenever I realize I’m reaching for my mouse, I’m keeping a rough mental tally of the reason for it. If I discover something that’s not pure navigation but interaction, I try to find and memorize the keyboard shortcut for it.
Should I have a hard time memorizing a shortcut, I print out a little self-made cheat sheet and put it on my desk until I don’t need it anymore. In those situations, you might also prefer remapping hard-to-remember shortcuts via Karabiner. I’ve tried Karabiner in the past, but ultimately didn’t want to leave it running for — in my case — just a handful of remaps.
Next, let’s talk about some universally applicable shortcuts for navigating text.
Navigate Text with macOS-native Shortcuts
macOS provides very semantic shortcuts to navigate text. It’s hard to find keyboard shortcuts that pay higher productivity dividends than those: they work everywhere where you can write and edit text: input fields on websites, native text editors like Pages, and non-native apps like Obsidian or Slack.
Here are some of them:
option + left/right arrowmoves the cursor between words.
cmd + left/right arrowmoves the cursor to the beginning or end of the current line
You can combine them with modifier keys, so for example:
shiftwill select text at the same time, with e.g.
cmd + shift + leftselecting everything from the cursor to the beginning of the line
backspacewill remove text, so e.g.
alt + backspacewill delete word-by-word
Let’s continue expanding on the idea of text navigation by adding a tried-and-tested tool for doing just that to your tool belt.
Navigate Text with VI keybindings
vi is one of the OGs in software. The core idea has been in action since the 70s. And what an idea it is: vi gives you several modes to interact with text. The ones I use most often are
visual mode and
visual mode optimizes for navigating text, while
insert mode is the mode of choice for editing or adding (inserting!) text.
I spend most of the time using vi inside
visual mode — and since this mode doesn’t manipulate text, vi now gives me my whole keyboard as a canvas for keyboard shortcuts helping me navigate it. Genius.
Here are some examples of the many additional options you’ll get for navigating text with vi keybindings:
lmoves the cursor forward a character,
ha character backwards
jmoves the cursor down a line,
kup a line
Suddenly, navigating inside text feels like a game. Let’s add some more keys to the mix:
wmoves the cursor forward word-by-word,
xwill delete the current character,
rreplace it with a character that you press immediately afterward, e.g.
r + awill replace the character that your cursor is on with an “a”.
ddeletes either a word (
dw) or a line (
vis for selecting text, with
Vselecting the whole line.
See how semantic those are? And it only gets better from there: you can chain these operators and/or motions together, and even add a count to the mix. An example:
3dw will delete the next three words,
2dd the next two lines.
vi gets even more of a time saver when you consider the different ways to switch into
iinserts text before the cursor,
aappends text after the cursor
cchanges text, so e.g.
ciwwill change the word the cursor is currently inside (basically it will delete the current word and put itself into
insertmode, so you can quickly replace the word with another text). This is super powerful when you want to edit text inside parentheses for example, with
ci'removing everything inside parentheses and placing your cursor in between them, ready to write.
Awill append to the end of the line and
I— guess what? — inserts text at the beginning of it.
There is a lot more you can do with vi keybindings, so I encourage you to check out one of the many vi cheatsheets to see what else you can do with it.
It’s worth noting that I’m not strictly talking about the actual vi editor, but more about its keybindings, which you can plug into your existing toolset easily.
For example, I use the amVim extension to get vi-like keybindings inside VSCode. In Obsidian, there’s a built-in vi-mode, which you can activate in the editor settings.
There’s even a Safari extension, Vimari, which lets you navigate inside Safari using vi keybindings.
It might take you a while to get used to navigating text with vi keybindings, but once you do, you’ll not look back.
Now that we’ve looked at ways how to speed up navigation inside apps and text using our keyboard, let’s look at speeding up text creation in the following sections.
Navigate macOS with Raycast
Raycast is an application launcher, Spotlight replacement, text expander and general utility platform which single-handedly cuts down the times you have to reach for your mouse in half. It’s extendable via extensions like Figma search, Todist overview, Jira search and many more. All of this makes it one of the first applications I install in a new macOS installation and highly encourage you to check it out.
Write More While Typing Less
If we think about translating thoughts to text using a keyboard, the best way to minimize the time it takes for a text to go from an idea to something written on your screen is to cut down on key presses.
The best way to do that reliably is text expansion — that is, until speech recognition or AI writing tools become embedded and capable enough to quickly and reliably translating your thoughts to prose.
The easiest (and cheapest) way to get started with text expansion is using the built-in one on macOS. You can find it in the keyboard settings of macOS under “Text”.
Once you set up text snippets to expand with your desired text, macOS will replace the former with the latter — this works in all applications and also gets synced with your iOS device(s).
Some useful text expansions I’ve got set up:
@@becomes my email address
Sounds good 👍
- gtg becomes
Gotta go, bye & thanks 👋
You can also use it for longer texts — this is also useful if you’re writing some boilerplate text frequently. And for easily using Unicode symbols, like
· which I’ve set up to be inserted when I type
If you like text expansions and want to take them up a notch with variables and other goodies, there’s e.g. Rocket Typist. Also, Raycast, which literally is a digital Swiss army knife at this point, supports creating and managing snippets.
The next paragraph is only relevant for developers, but using code snippets, especially for repeatedly used boilerplate like a React component (imports at the top, render function at the bottom etc.), using the excellent built-in snippets functionality in VSCode makes sense. You can also create project-specific snippets (and commit them to Git to version control and share them with collaborators). And, of course, map them to a shortcut.
Text expansion has its limits — it feels amazing when you can use it, but you obviously can’t use it all the time. So, in the final section, let’s talk about increasing raw typing speed.
Typing faster — and using the shortcuts mentioned above effectively — starts and ends with being able to touch type.
And ideally, touch type well, so upwards of 60 words per minute with an accuracy of ≥ 90%.
Like being a good runner or tennis player, this requires regular and conscious training. While there are multiple websites with which you can test & train your typing speed, the app I use and found most helpful on macOS is KeyKey. It’s simple, functional and beautiful — giving you stats, different difficulty levels and the option to use different keyboard layouts.
Speaking of alternative keyboard layouts — if you feel that using QWERTY is holding you back, there’s a wonderful world of alternative keyboard layouts, like Colemak or Dvorak out there, both promoted as being more ergonomic and speedier to type with than QWERTY. I can’t confirm or deny that myself as so far, I’ve stuck with QWERTY.
To convert my existing DE keyboards, I bought keyboard stickers on Etsy.
If you want to learn more about alternative keyboard layouts, get acquainted with some premium mechanical keyboards and generally venture deeper into the keyboard-driven rabbit hole, I recommend Ben Vallack’s YouTube channel.
Happy hacking! ⌨️ 🥷