Where to start First steps track · 15 stages
Linux Labs

vim — editing files in the terminal

cheat sheet · vim / vi https://lab.dimsanych.ru/en/wiki/vim/

Cheat sheet

  • i enter insert mode to type text
  • Esc go back to Normal
  • :w save
  • :q quit
  • :wq save and quit
  • :q! quit without saving
  • /text search forward through the file
  • :%s/a/b/gc replace across the whole file, confirming each replacement

Options

Command-line flags, not in-editor commands: vim +42 file opens the file straight at line 42, vim -R file opens it read-only (protection against accidental edits), vim -u NONE starts without your personal ~/.vimrc — useful for checking whether your config is the cause of odd behavior.

Loading…