Change
c is delete-then-insert, atomically.
c is the change operator. cw changes a word; cc changes a line; C changes to end of line. S and s are short forms that change a whole line and a single character respectively.
c is the shortcut for d-then-i: it deletes the same range d would, and drops you straight into insert mode at that spot. Then Esc closes the change as one undoable, dot-repeatable unit.
| Key | Note |
|---|---|
| c | |
| w |
| Key | Note |
|---|---|
| C |
| Key | Note |
|---|---|
| c | |
| c |
| Key | Note |
|---|---|
| S |
| Key | Note |
|---|---|
| s |
Reference
| Key | Action | Equivalent |
|---|---|---|
| c{motion} | Change range | d{motion} + i |
| cc | Change line | โ |
| C | Change to end of line | c$ |
| S | Change line | cc |
| s | Substitute one char | cl |
| cw | Change word (note: like ce) | โ |
| ciw | Change inner word (text object; see Text Objects) | โ |
| ca' | Change around quotes (text object; see Text Objects) | โ |
Worked example โ cw is c then w
Change = delete + Insert in one step.
[missing screenshot editing.change/frame_01.color.svg โ run python content/render_screenshots.py]
[missing screenshot editing.change/frame_02.color.svg โ run python content/render_screenshots.py]
Note the trailing space stays โ cw stops just before the next word. (One of cw's well-known quirks.)
[missing screenshot editing.change/frame_03.color.svg โ run python content/render_screenshots.py]
[missing screenshot editing.change/frame_04.color.svg โ run python content/render_screenshots.py]
See also: Delete, More Ways into Insert, Repeat Last Change, The Universal Grammar