normal·mode

glossary

New to Vim's shorthand? This page explains how to read key notation like <C-u>, {motion} and [count], then the words Vim and Neovim users throw around, from operator to WORD. Hover a key chip anywhere on the site for a quick reminder, and type :glossary {term} from any page to jump straight to an entry.

64 terms

1Reading the notation

Lessons, cheat sheets and Neovim's own help all write keys in the same shorthand. Once you can read it, any key reference makes sense.

#<…>: special keys

Text inside angle brackets names one key, usually one that doesn't type a character. When you're pressing keys, you press that key and never type the brackets or the letters between them. <Esc> is the Escape key and <CR> is Enter, so A;<Esc> is three keystrokes: A, a semicolon, then Escape. (In a mapping or a config file you do write the notation out, as in :nnoremap <Leader>w :w<CR>.)

<Esc>Esc<CR>⏎A;<Esc>A;Esc

#<C-x>: Ctrl keys

<C-u> means hold Ctrl, tap u, let go. It counts as a single keystroke. Case doesn't matter for Ctrl plus a letter, so <C-u> and <C-U> are the same key. Neovim's help spells it CTRL-U, and you may also see it printed as ^U. On a Mac this is the Control key, not Command.

<C-u>Ctrl-u<C-w>Ctrl-w<C-r>Ctrl-r

practise itThe screen: H M L, scrolling and zzFix it without leaving: <C-h>, <C-w>, <C-u>

#Capital letters and <S-…>

A capital letter means Shift plus that letter, and it's usually a different command from the lowercase one: a appends after the cursor, A appends at the end of the line. Keys without a capital form are written with <S-…>, as in <S-Tab> for Shift+Tab. Symbols are written as themselves, so $ is whichever key types a dollar sign on your keyboard.

AAGG<S-Tab>Shift-⇥

practise itDoors into Insert mode: i, a, I, A, o, O

#<CR>: Enter

<CR> is the Enter key. The name comes from carriage return, and <Enter> and <Return> mean the same thing. You'll see it at the end of anything typed on the command line or into a search, as in :w<CR> or /todo<CR>, because nothing happens until you press it. Key chips on this site draw it as ⏎.

:w<CR>:w⏎/todo<CR>/todo⏎

practise itSearch: / ? n and NThe whole file: gg, G, {n}G and :{n}

#<Esc>: Escape

<Esc> is the Escape key, your way back to Normal mode. It leaves Insert or Visual mode, cancels a half-typed command and closes the command line without running anything. <C-[> sends exactly the same key, and some people prefer it because it's closer to the home row.

<Esc>Esc<C-[>Ctrl-[

practise itDoors into Insert mode: i, a, I, A, o, O

#<BS>, <Tab>, <Space> and other named keys

A few more keys get names because they're invisible or easy to misread in print: <BS> is Backspace, <Tab> is Tab, <Space> is the space bar and <Del> is Delete. The arrow keys are <Up>, <Down>, <Left> and <Right>. Chips here draw them as ⌫, ⇥, ␣, Del and arrows.

<BS>⌫<Tab>⇥<Space>␣<Del>Del<Up>↑

practise itFix it without leaving: <C-h>, <C-w>, <C-u>

#<lt>, <Bar> and <Bslash>

Three ordinary characters that need a name inside key notation, because otherwise they'd be read as part of it. <lt> is a plain <, so <lt>Esc> types the text <Esc> instead of pressing Escape. <Bar> is the | character, which separates commands on the command line, and <Bslash> is a backslash. You'll mostly meet them in mappings and in this site's solutions.

<lt><<Bar>|<Bslash>\<lt>Esc><Esc>

#<Leader>

A stand-in key for your own shortcuts. A mapping written as <Leader>w uses whatever mapleader was set to when that mapping was created, so set it first. Neovim, like Vim, falls back to a backslash when it's unset, so out of the box <Leader>w means \ then w. Many configs make it the space bar (vim.g.mapleader = ' ' in Lua). This site's page keys follow that habit: <Space>f opens the lesson finder.

<Leader>w<Space>f

#Key sequences: gg, ciw, <C-w>j

Most commands are several keys typed one after another, not pressed together. gg is g, then g again. ciw is c, then i, then w. Only a modifier inside angle brackets is held down, and only for its own key: <C-w>j is Ctrl+w, let go, then a plain j.

ggggciwciw<C-w>jCtrl-wj

practise itOperator + motion: d, c and yMove between windows: <C-w>h j k l, w, p

#{char}, {motion} and other {…} slots

Curly braces mark a slot you fill in yourself; the braces are never typed. f{char} means f followed by any character, such as f( or fx. d{motion} means d followed by a motion, like dw or d$. {a-z} stands for one lowercase letter, and words like {pattern} or {new} describe what goes in that spot. Hover a chip like these anywhere on the site for a reminder.

f{char}d{motion}m{a-z}:s/{old}/{new}/

practise itFind a character: f, t, F, T, ; and ,Operator + motion: d, c and y

#{count} and [count]

A count is a number typed in front of a command: 3j moves down three lines and 2dd deletes two. This site writes the slot as {count} (or {N}). Neovim's help writes [count], because square brackets mean optional, and leaving the number out usually means 1. Some commands read the count as a position instead: {count}G goes to that line. Counts on both halves of an edit multiply, so 3d2w deletes six words.

3j2dd{count}G3d2w

practise ith j k l, and countsCounts: do it N times

#"x: choosing a register

A double quote plus a register name, typed before a command, tells that command which register to use. "ayy yanks the line into register a, and "ap puts it back later. Neovim's help shows this optional prefix as ["x]. Where a register name is required instead, as after <C-r> in Insert mode, the slot is written {register}.

"ayy"ap"_dd<C-r>{register}

practise itNamed registers: "a to "zPaste while typing: <C-r>{register}

#:command<CR>

A sequence that starts with : opens the command line along the bottom of the screen. The characters after it are typed there and <CR> runs the command, so :w<CR> is three keystrokes: colon, w, Enter. Key lists such as the cheat sheet often leave off the final <CR> and just say :w, the way you'd name the command out loud.

:w<CR>:w⏎:%s/a/b/g<CR>:%s/a/b/g⏎

practise itLine ranges: :d, :j and friendsSubstitute: :s, ranges and flags

#Key chips on this site

Where the site shows keys that were actually pressed (your key log, the solution and the par line), each keystroke gets its own chip and special keys are drawn compactly: ⏎ is Enter, Esc is Escape, ⇥ is Tab, ⌫ is Backspace, ␣ is a space, and Ctrl combos read like Ctrl-u. Elsewhere keys appear in notation, like <C-u>. Hover any chip that uses notation to see what it means.

<C-u>Ctrl-u<CR>⏎<Esc>Esc<Tab>⇥<BS>⌫<Space>␣<S-Tab>Shift-⇥

2Modes

Vim is modal: what a key does depends on the mode you are in. The statusline under every drill shows whether you're in Normal, Insert, Visual or Replace mode.

#Normal mode

Where Vim starts, and where <Esc> brings you back to. Keys here are commands rather than text: x deletes a character, w jumps to the next word, dd deletes a line. Most editing time is spent here, with short trips into Insert mode to type. A drill only counts as solved once you're back in Normal mode.

<Esc>xwdd

practise itDoors into Insert mode: i, a, I, A, o, Oh j k l, and counts

#Visual mode: v, V and <C-v>

Select first, then act. v starts a characterwise selection, V a linewise one (whole lines) and <C-v> a blockwise one (a rectangle of columns). Motions stretch the selection, and an operator such as d, y or > then works on exactly what's highlighted. Handy when you want to see the text before you change it.

vV<C-v>gv

practise itv, V and Ctrl-v: select, then actEdit a column: I, c and r on a block

#Replace mode

Entered with R. Each character you type overwrites the one under the cursor instead of pushing it along, like the overtype mode some editors toggle with the Insert key. <BS> brings back what was there before. To swap a single character, r{char} does it without changing mode at all.

Rr{char}

practise itType over text: r and R

#Command-line mode

Typing :, / or ? moves you to a one-line prompt along the bottom of the window. After : you type an Ex command such as :w or :sort; after / or ? you type a search pattern. <CR> runs it, <Esc> gives up, and <Up> recalls earlier entries.

:/?

practise itLine ranges: :d, :j and friendsSearch: / ? n and N

#Operator-pending mode

The brief state after you type an operator like d, c or y, while Vim waits to hear what to act on. d on its own changes nothing yet; a motion or text object completes it (dw, ci(), and <Esc> calls it off. Drills don't count as finished while an operator is still pending.

ddwci(

practise itOperator + motion: d, c and y

#Terminal mode (Neovim)

Neovim can run a shell, or any other program, inside a buffer with :terminal. Press i to enter Terminal mode, where your keys go straight to that program, and <C-\><C-n> to get back to Normal mode. The drills here run in a browser, so they don't cover it.

:terminali<C-\><C-n>

3The grammar of edits

Normal-mode edits are built from small parts that combine. Learn the parts and you can say a lot with very few keys.

#Operator

A command that acts on a stretch of text you describe right after it. The everyday ones: d deletes, c changes (deletes, then drops you into Insert mode), y yanks (copies), > and < shift indentation, gU and gu change case, and Neovim adds gc for comments. On its own an operator just waits for a motion or a text object.

d{motion}c{motion}y{motion}gU{motion}>{motion}

practise itOperator + motion: d, c and yCase, indent and replace: gU, gu, >, < and r

#Motion

Any key that moves the cursor: w, j, $, f,, }, G, even a search with /. On its own it just moves you. After an operator it marks out the text to act on, from the cursor to wherever the motion would land, so d$ deletes to the end of the line. A word motion is one that moves by words: w, b, e and ge, plus their WORD versions W, B, E and gE (Neovim's help groups all eight under word motions).

we$f{char}}G

practise itWords and WORDS: w b e ge, W B E gEAlong a line: 0 ^ $ g_ and |Search as a motion: d/ c/ d?

#Text object

A way to name a chunk of text by what it is instead of by moving across it: iw is the word under the cursor, i" the inside of a quoted string, ap a paragraph plus the blank lines after it. They work in Visual mode or right after an operator, and the cursor can sit anywhere inside the object. An i object is the inner part; an a object also takes the surrounding space or the delimiters.

ciwdi"yapci(dit

practise itWords: iw, aw, iW and aWQuotes: i", a", i' and i`Brackets: i(, i{, i[ and i<

#Verb + noun

The idea that makes Vim click: an edit is a little sentence. The operator is the verb and a motion or text object is the noun, so dw reads "delete word", ci( "change inside parentheses" and yap "yank a paragraph". Every new verb works with every noun you already know, and the other way round, which is why a small vocabulary goes a long way.

dwci(yapgUiw

practise itOperator + motion: d, c and yMix and match: any operator, any object

#Doubled operators: dd, cc, yy

Typing an operator twice makes it act on the current line: dd deletes it, yy yanks it, cc replaces it, >> indents it and gUU uppercases it. Put a count in front to cover more lines, so 3dd deletes this line and the two below it.

ddyycc>>gUU3dd

practise itLine shortcuts: dd, cc, D, C, J and friends

#Characterwise, linewise, blockwise

The three shapes a piece of text can take. Characterwise text runs from one character to another (what dw or v covers). Linewise text is whole lines (dd, dj, V). Blockwise text is a rectangle of columns (<C-v>). The shape travels with the text into its register, which is why p puts a deleted line on a new line below instead of in the middle of the current one.

dwdddjvV<C-v>

practise itv, V and Ctrl-v: select, then actThe unnamed register: x, dd, yy and p

#Inclusive and exclusive motions

For characterwise motions: whether the edit takes both ends of the stretch it covers. An inclusive motion does, so de deletes through the last letter of the word and df, takes the comma with it. An exclusive motion leaves out the end nearer the bottom of the file. Going forward, that's where the motion lands: dw stops just before the next word starts. Going backward, it's where the cursor started: db deletes back to the start of the word but keeps the character under the cursor. t is inclusive like f, yet dt, stops one short because t lands just before the comma. When an edit grabs one character too many or too few, this is usually why.

dedwdbdf,dt,

practise itFind a character: f, t, F, T, ; and ,Search as a motion: d/ c/ d?

#The dot command: .

. repeats your last change: the last command that edited text, including anything you typed during that visit to Insert mode. Fix one word with cw, type the new word, press <Esc>, then move to the next one and press . to make the same fix. Motions and : commands aren't repeated (@: does that for the command line). A count, as in 3., replaces the original count.

.3.cw@:

practise itThe dot command: repeat the last changeRepeat a Visual edit with .Repeat the last Ex command: @: and @@

#Undo and redo

u undoes the last change and <C-r> redoes it (in Insert mode <C-r> pastes a register instead). A whole visit to Insert mode, from i to <Esc>, normally undoes as one step. Vim keeps an undo tree rather than a single list, so even changes you undid and then typed over can still be reached with g- and g+ (in Neovim itself; the browser drills keep a simple list).

u<C-r>g-g+

practise itPut, undo and redo: p, P, u and <C-r>

4Words, sentences and other units

Motions and text objects follow exact definitions of these, and those definitions decide where a motion stops.

#word

Either a stretch of keyword characters (letters, digits and _) or a stretch of punctuation and other symbols. Spaces separate words but don't belong to them, so foo.bar(x) holds six words: foo, the dot, bar, (, x and ). An empty line also counts as a word, which is why w stops on one. The lowercase motions w, b, e and ge, and the iw/aw objects, move by these. Which characters count as letters is up to the iskeyword option; the default covers letters (accented ones too), digits and _.

wbegeiw

practise itWords and WORDS: w b e ge, W B E gEWords: iw, aw, iW and aW

#WORD

A run of any non-blank characters, split only by whitespace. Where foo.bar(x) is six words, it's a single WORD, and an empty line counts as one too. The capital keys W, B, E, gE, iW and aW work in WORDs, which makes them the fast choice through URLs, file paths and punctuation-heavy code.

WBEgEiW

practise itWords and WORDS: w b e ge, W B E gEWords: iw, aw, iW and aW

#Line

Everything up to a line break. A long line may wrap across several rows on screen but is still one line to Vim, so j hops over the wrapped part; gj and gk move by screen rows instead. Line numbers count real lines, and those are what 42G or :42 jump to.

jgj42G:42<CR>

practise itThe whole file: gg, G, {n}G and :{n}h j k l, and counts

5Registers, marks and other memory

Vim quietly remembers a lot as you work: text, positions, keystrokes and searches.

#Register

A named slot that holds text: Vim's version of a clipboard, except there are dozens of them. Every yank, delete and change writes to one, and p puts one back. Usually that's the unnamed register and you don't need to think about it; type " and a name before a command to use a different one. :reg shows what each register holds.

"ayy"ap:reg

practise itThe unnamed register: x, dd, yy and pNamed registers: "a to "z

#Kinds of register

The ones you'll meet most:

  • "" unnamed: what a plain p uses. It follows your latest delete or yank.
  • "0 yank: your latest yank, which deletes leave alone.
  • "1 to "9 numbered: recent deletes and changes of a line or more, newest in "1.
  • "- small delete: the latest delete shorter than a line.
  • "a to "z named: filled only when you ask. "A to "Z add to them instead of replacing.
  • "_ black hole: text sent here is simply gone, and no other register changes.
  • "+ and "* the system clipboard (not available in the browser drills).
  • Read-only: ". the last inserted text, ": the last command line and "% the file name.
  • "/ holds your last search (you can't yank or delete into it), and "= is the expression register.
"""0"1"-"a"_"+

practise itThe yank register "0 and the black hole "_Named registers: "a to "zDo the maths in place: <C-r>=

#Mark

A saved position. ma sets mark a where the cursor is; `a jumps back to that exact spot and 'a to the first non-blank of its line. Lowercase marks belong to one buffer, while capital ones like mA work across files. Vim also keeps some marks for you: `. takes you to your most recent edit, and '' returns to the line you jumped away from.

ma`a'amA`.''

practise itMarks: m, ` and 'The change list: g; and g,

#Jumps and the jump list

Some motions count as jumps: the long-distance ones, like G, gg, a search with / or n, %, { and }, or going to a mark. Before each jump Vim notes where you were in the jump list, so <C-o> steps back to older spots and <C-i> (often the same key as <Tab>) steps forward again, much like a browser's back and forward buttons. Small moves such as w or j don't count.

<C-o><C-i>:jumps

practise itThe jump list: CTRL-O and CTRL-I

#Change list

Vim also remembers where each change happened. g; steps back through those places and g, steps forward again, a quick way to return to your edit after looking around elsewhere. The latest one is also kept as the mark ., so `. jumps straight to it.

g;g,`.:changes

practise itThe change list: g; and g,

#Search pattern

What you type after / or ? (and inside :s and :g) is a pattern, Vim's own flavour of regular expression. Most characters match themselves, but a few are special: . matches any character, * repeats the thing before it, and ^ and $ pin the match to the start or end of a line. Starting a pattern with \v ("very magic") makes it read more like the regex you may know from other languages.

/todo<CR>/^#<CR>/\v\d+<CR>

practise itSearch: / ? n and NVery magic \v, very nomagic \V

#Search offset

An extra instruction after a second / that moves the cursor relative to the match. /foo/e lands on the last letter of foo instead of the first, /foo/e+1 one character after it, /foo/s-1 one before the start, and /foo/+1 at the start of the line below. An empty pattern reuses the previous one, so //e repeats the last search with a new offset.

/foo/e<CR>/foo/s-1<CR>//e<CR>

practise itOffsets and match edges: /e, \zs, \ze

6The editor itself

Where text lives, how it is shown and how you talk to Neovim.

#Buffer

What Vim actually edits: its own in-memory copy of a file's text. Your changes stay in that copy until :w writes them back to disk. Many buffers can be open at once even if you can see only one; :ls lists them, and :bn / :bp cycle through them. On this site the editor in each drill is labelled buffer too.

:w:ls:bn:bp

practise itSplit the screen: <C-w>s, <C-w>v, :sp, :vs

#Tab page

A separate screen with its own arrangement of split windows. You can keep several, and gt / gT flip to the next or previous one. Unlike browser tabs they aren't one per file: a tab can hold several windows, and the same buffer can appear in more than one tab.

:tabegtgT<C-w>T

practise itTab pages: :tabe, gt, gT, <C-w>T

#Range

Which lines an Ex command works on, written right after the :. :3,7d deletes lines 3 to 7. % means every line, . the current line, $ the last one, and .,+2 this line and the two after it. Press : while text is selected and Vim fills in '<,'>, the lines of the selection.

:3,7d:%s/a/b/g:.,+2d:'<,'>

practise itLine ranges: :d, :j and friendsSubstitute: :s, ranges and flags

#Option

A setting that changes how Vim behaves, changed with :set. :set number turns line numbers on, :set nonumber turns them off, :set number! flips it and :set number? shows the current value. In a Lua config the same thing is vim.o.number = true. Neovim's help writes option names in single quotes, like 'ignorecase'.

:set number:set nonumber:set number!:set number?

practise itCase: ignorecase, smartcase, \c and \C

#Mapping

A key binding of your own: when you type the left-hand side, Vim acts as if you had typed the right-hand side. :nnoremap <Leader>w :w<CR> makes <Leader>w save the file in Normal mode; in Lua that's vim.keymap.set('n', '<Leader>w', ':w<CR>'). The nore means non-recursive: the right-hand side is used as written, without expanding other mappings inside it.

:nnoremap<Leader>w

#:help

Neovim's built-in manual, and a very good one. :h w explains the w key, :h i_CTRL-W covers <C-w> in Insert mode, :h notation describes the shorthand on this page and :h word gives the exact definition of a word. Inside the help, <C-]> follows a link and <C-o> comes back. (On this site, :h opens the site's own keymap help, and :h {key} searches the cheat sheet.)

:h w:h i_CTRL-W:h notation:h word

7Words this site uses

How normal mode itself talks about drills and your progress.

#Drill

One small exercise in a lesson: an editor with some text, a target to reach and a prompt naming the technique to use. It's solved when the buffer matches the target, the cursor is in the right spot (if the target marks one) and Vim is settled: back in Normal mode with nothing half-typed.

:next:prev]d[d

#Variant

Every drill comes with several variants: different text that practises the same keys. One is picked at random for each attempt, and some movement drills also shuffle where you start and where you need to go, so you learn the technique rather than one answer.

#Fresh text on retry

:retry, the ↻ retry button, or r while you're outside the editor restarts the drill with a different variant. A second attempt is never a replay of the first, so it tests the skill and not your memory of the answer.

:retryr

#Par

The keystroke count of the drill's reference solution, as in golf. Every key press counts, including <Esc>, <CR> and each letter typed in Insert mode. A Ctrl combo like <C-u> is one keystroke, Shift or Ctrl on its own is none, and commands for the site itself, like :hint, are free. Finishing at or under par earns a ★; going over is still a pass, with room to improve.

#Target

The pane next to the editor showing what the buffer should look like when you're done. When the cursor's final spot counts, a block in the target marks it, and the buffer outlines the same spot as soon as your text matches (straight away in movement drills, where only the cursor moves). The target toggle turns that outline off, as does :set notarget typed from page keys (after :q). The diff toggle, on by default, shows what still needs adding (green) or removing (red). Window and tab drills show the layout to reach instead.

#Buffer pane

The editor where you work on a drill. It's a Vim emulator running in the browser (CodeMirror with a Vim layer, set up to behave like Neovim's defaults), so the keys taught here do what they would in nvim. A few things only work in a real Neovim, such as the undo tree's g- and g+ or buffer commands like :ls. :q hands your keys back to the page, and i jumps back into the editor.

:qi

#Disabled keys

Some drills switch off keys that would skip the technique being taught. They're listed under the prompt as disabled, and pressing one flashes a warning instead of acting. A disabled key still works as an argument, so with h disabled fh still finds an h. Arrow keys are off in every drill by default (except on the command line), and the settings page has more challenges, such as no hjkl.

#Cleared

A drill you've solved without revealing its solution first. The home page counts how many you've cleared, and each module's lesson list shows a green dot per cleared drill, or a yellow one once you've also matched par. Progress is saved in your browser, and the settings page can export it.

#Assisted

A finish after you revealed the solution (with :solution or the button). It's recorded, but the drill only counts as cleared once you solve it again without peeking. Hints are free: :hint shows them one at a time, gentlest first, and doesn't mark the drill as assisted.

:hint:solution

#Example

Each drill can show an example: the par keys replayed one at a time on different text, with each key shown as it goes in, so you can watch the technique before trying it on your own variant. :example shows or hides it from the keyboard.

:example

#Page keys (NAV)

Outside the editor, the site itself listens for Vim-style keys: j and k scroll or move through lists, / finds lessons, : opens a command line and ? lists every key. The pill in the bottom-right corner reads NAV while page keys are live and DRILL while you're typing in an editor.

jk/:?<Space>g
outside the editor the page is in normal mode: ? keymaps · / find · : commandsfound this useful? ☕ support it ·credits · source · not affiliated with Vim or Neovim