David Härer / Cheatsheets

Vim Cheatsheet



How do I enable / use spell-checking?

How can I save a macro?

To save a macro in register x:

  1. In normal mode type qx, record the macro and save with q.
  2. Open your .vimrc or init.vim in another buffer.
  3. Add let @x = '...'.
  4. Replace ... with "xp to paste the content of register x.

Now register x will always have the recorded macro on startup. To use it type @x in normal mode.

How can I create a number sequence?

Write a column of zeros.

0
0
0

Highlight the column with Ctrl + v. Type g followed by Ctrl + a.

1
2
3