Chrome, Terminal, and Vim Keyboard Shortcuts: A Practical Guide
2022-04-24

Keyboard shortcuts are one of those things where you think "why bother memorizing this?" while learning them, and "how did I ever live without this?" once they're muscle memory.

This post covers the shortcuts I actually use every day across three tools: Chrome browser, shell terminal, and Vim editor. This isn't an exhaustive dump of every shortcut from the official docs — it's the ones I reach for in real work. Shortcuts with strikethrough are ones that exist but I rarely use in practice.


Chrome Browser

Chrome is where developers spend a huge chunk of their time. Reading docs, debugging in DevTools, reviewing PRs — it all happens here. Learning a few key shortcuts lets you fly between tabs without reaching for the mouse.

Tabs and Windows

This is the highest-frequency group. Restoring accidentally closed tabs (Ctrl+Shift+T) is a lifesaver.

ActionShortcut
New windowCtrl + N
New incognito windowCtrl + Shift + N
New tabCtrl + T
Restore last closed tabCtrl + Shift + T
Switch to next tabCtrl + Tab
Jump to the rightmost tabCtrl + 9
Go back one pageAlt + ←
Go forward one pageAlt + →
Close current tabCtrl + W

Pro tip: Ctrl+1 through Ctrl+8 jump directly to the tab at that position. When you have a dozen tabs open, this is way faster than Ctrl+Tab cycling.

Feature Shortcuts

ActionShortcut
Toggle bookmarks barCtrl + Shift + B
Open historyCtrl + H
Open downloadsCtrl + J
Find on pageCtrl + F
Next search matchCtrl + G
Open DevToolsF12 or Ctrl + Shift + I
Open DevTools consoleCtrl + Shift + J

Mouse Combos

Your mouse has combo moves too, especially the middle click (if your mouse has one).

ActionMethod
Open link in background tabCtrl + Click
Open link in new windowShift + Click
Zoom inCtrl + Scroll up
Zoom outCtrl + Scroll down
Reset zoomCtrl + 0

Level Up: Vimium C Extension

If you're a Vim user, I strongly recommend the Vimium C browser extension. It adds Vim-style navigation to Chrome:

Once you install it, you can basically browse the web without touching your mouse.


Shell Terminal

When editing commands in the terminal, most people use arrow keys to move one character at a time. That's painfully slow. Your shell has a built-in set of Emacs-style shortcuts (readline keybindings) that make editing long commands dramatically faster.

Cursor Movement

This is the most valuable group to memorize. Ctrl+A to jump to the beginning and Ctrl+E to jump to the end — I use these literally every day.

ShortcutAction
Ctrl + AJump to beginning of line
Ctrl + EJump to end of line
Ctrl + FMove forward one character (same as right arrow, not worth memorizing)
Ctrl + BMove backward one character (same as left arrow, not worth memorizing)
Alt + FJump forward one word
Alt + BJump backward one word
Ctrl + LClear screen, cursor to top-left (same as the clear command)

Real-world scenario: You've typed a long command and realize the beginning is wrong. Ctrl+A jumps you to the start instantly — 10x faster than holding the left arrow key.

Text Editing

ShortcutAction
Ctrl + DDelete character at cursor
Ctrl + TSwap character at cursor with the one before it
Alt + TSwap word at cursor with the one before it
Alt + LLowercase from cursor to end of word
Alt + UUppercase from cursor to end of word

I've struck these through because I rarely use them in practice. That said, Alt+U is occasionally handy for uppercasing variable names.

Cut and Paste

Shell has its own clipboard system called the "kill ring." You cut with Ctrl+K/U and paste with Ctrl+Y — it's separate from your system clipboard.

ShortcutAction
Ctrl + KCut from cursor to end of line
Ctrl + UCut from cursor to beginning of line
Alt + DCut from cursor to end of current word
Alt + BackspaceCut from cursor to beginning of current word
Ctrl + YPaste the most recently cut text

Real-world scenario: You've typed a command but aren't ready to run it yet. Ctrl+U cuts the whole line, you do something else, then Ctrl+Y pastes it back when you're ready. No need to retype anything.

Command History

ShortcutAction
Ctrl + RReverse search through command history (incredibly useful)
Ctrl + PPrevious command (same as up arrow)
Ctrl + NNext command (same as down arrow)
!!Run the last command again
sudo !!Re-run the last command with sudo

Ctrl+R is the single most valuable terminal shortcut. Press it, start typing any part of a previous command, and the shell fuzzy-searches your history. Ran a complex docker command an hour ago? Ctrl+R then type docker to find it instantly.


Vim Editor

Vim has a steep learning curve, but once you're past the initial hump, your editing speed takes a quantum leap. I'm not going to try to cover everything here — just the core operations that matter most.

Mode Switching

Vim's most counter-intuitive concept is modes. The key insight: normal mode is the default state; insert mode is temporary. You dip into insert mode to type, then come back to normal mode to navigate and manipulate.

ShortcutActionWhen to use
iInsert before cursorMost common way to start typing
IInsert at beginning of lineAdding something to the line start
aInsert after cursorAppending after current position
AInsert at end of lineAdding to the end of a line
oOpen new line below and insertMost common — adding a new line
OOpen new line above and insertInserting above current line
sDelete character and insertReplacing a single character
SDelete entire line and insertRewriting a whole line
EscReturn to normal modeAnytime, anywhere

Cursor Movement

ShortcutAction
h / j / k / lLeft / Down / Up / Right
wJump to next word start
bJump to previous word start
eJump to end of current word
0Jump to beginning of line
$Jump to end of line
ggJump to beginning of file
GJump to end of file
Ctrl + DScroll down half a page
Ctrl + UScroll up half a page
{ / }Jump to previous / next blank line (paragraph navigation)

Beginner tip: Don't force yourself to use hjkl right away. Arrow keys work fine. Get comfortable with other operations first, and hjkl will come naturally over time.

Delete Operations

Vim's delete operations follow a verb + scope grammar that's incredibly powerful once you internalize the pattern.

ShortcutAction
xDelete character at cursor
ddDelete entire line
dwDelete from cursor to next word start
dawDelete entire word (including surrounding spaces)
diwDelete entire word (keeping surrounding spaces)
DDelete from cursor to end of line (same as d$)
dGDelete from current line to end of file
dggDelete from current line to beginning of file

Change Operations

The c commands are the upgraded version of d — they delete and then drop you into insert mode, saving a keystroke.

ShortcutAction
cwChange to end of word
ciwChange entire word
ci"Change inside quotes
ci(Change inside parentheses
ccChange entire line
CChange from cursor to end of line

ciw is my most-used Vim command. Cursor can be anywhere in the word — ciw selects and replaces the whole thing. Renaming variables, changing function arguments — it's absurdly convenient.

Copy and Paste

ShortcutAction
yyYank (copy) entire line
ywYank to end of word
pPaste after cursor
PPaste before cursor

Undo and Redo

ShortcutAction
uUndo
Ctrl + RRedo

Search and Replace

ShortcutAction
/keywordSearch forward
?keywordSearch backward
nJump to next match
NJump to previous match
*Search for word under cursor

For find-and-replace, use the :s command with the syntax :%s/old/new/flags:

:%s/foo/bar       " Replace first foo on each line with bar
:%s/foo/bar/g     " Replace ALL foo with bar globally
:%s/foo/bar/gc    " Replace all, but ask for confirmation each time
:%s/foo/bar/gi    " Replace all, case-insensitive

Useful Command-Line Mode

:w                " Save
:q                " Quit
:wq               " Save and quit
:q!               " Quit without saving (force)
:w !sudo tee %    " Forgot to open with sudo? This saves the day
:set nu           " Show line numbers
:set nonu         " Hide line numbers

My Vim Advice

  1. Don't try to learn everything at once. Add 2-3 new commands per week. Use them until they're muscle memory, then learn more.
  2. Master quitting Vim first. :q! to force quit, :wq to save and quit. Get those down, then build from there.
  3. ciw, dd, and o cover a huge portion of daily editing. Prioritize these three.
  4. If you mostly write code, consider the Vim extension in VS Code. You get Vim's editing efficiency while keeping VS Code's ecosystem.