Synonyms and Shortcuts
Equivalent commands you'll see in different vimrcs.
Many Vim commands have multiple keystroke spellings โ D = d$, C = c$, S = cc, x = dl, X = dh, etc. Knowing the synonyms helps you read other people's code and your own old macros.
Vim has many single-key shortcuts that compress an operator+motion pair. Knowing them helps you type faster and read other people's keystrokes.
| Shortcut | Equivalent | Meaning |
|---|---|---|
| D | d$ | Delete to end of line |
| C | c$ | Change to end of line |
| Y | yy (NOT y$ โ historical wart) | Yank line |
| S | cc | Change whole line |
| s | cl | Substitute one char |
| x | dl | Delete char forward |
| X | dh | Delete char backward |
| & | :s | Repeat last substitute (current line) |
| ZZ | :x | Save if changed, quit |
| ZQ | :q! | Quit, discard changes |
| U | (restore current line โ rarely used) | |
| . | (repeat last change) |
See also: Complete Key Reference