Skip to main content

Edit Text File (vim)

Edit Text File (vim)

Insert Text

  • i: Insert text before the selected text
  • a: Insert text after the selected text
  • o: Insert text on a new line

Select Text

  • v: Select a single character
  • Ctrl + v: Select text vertically
  • Shift + v: Select text horizontally

Copy and Paste

  • y: Copy a line
  • y{n}y: Copy n lines
  • p: Paste

Undo / Redo

  • u: Undo
  • Ctrl + r: Redo

Save and Exit

  • Save: ESC:w
  • Exit: ESC:q
  • Save and Exit: ESC:wq
  • Force Exit: ESC:q!