save your typing with compound command in Vim

Tags: vim

Vim has special command that allow us to save time by typing only one key instead of typing many keys.

We can call it as compound command which compounds two or more command into one command.

When we use these compound commands, they switch mode from normal mode to insert mode.

Example of compound

compound command => is equivalent to

  • C => c$ change to the end of line
  • s => cl change one character
  • S => ^C change entire line or cc
  • I => ^i insert from the beginning of line
  • A => $a append text at the end of line
  • o => A+enter add new line below current line
  • O => ko or k$a+enter add new line above current line

If you find your self tying many keys to solve a problem. Think to your self if we can use compound command to get it done.