🫐 Commands
Vim

VIM

Vim is a keyboard-only text editor. Its used when making commit messages during git merges. To use Vim:

  1. Create a vim file vim filename
  2. Move around the file with the arrow keys or h, j ,k, l
  3. Switch between visual, insert, or normal mode with keys v, i, and esc

Modes

  • v visual mode read file
  • i insert mode edit file
    • x delete characters
    • dd delete entire line
    • u undo
  • esc command/normal mode - use file commands

Commands

  • :set number add numbers to vim ui
  • :2 navigates to line 2
  • :!node run with node
  • :help see commands
  • :q quit — changes haven\’t been made
  • :q! quit and discard changes
  • :w save changes
  • :wq write the changes (save) and quit