Skip to content

Vim Basics A Quick Start Guide

Vim is a lightweight, keyboard-driven text editor available on almost every Unix-like system. This quick guide covers the essential concepts and commands to get productive fast.

  • Normal (command) mode: navigate and manipulate text.
  • Insert mode: type text (enter with i, a, o; return to Normal with Esc).
  • Visual mode: select text (v for char, V for line, Ctrl+v for block).
  • h j k l : left, down, up, right
  • w / e / b : word forward, end of word, word back
  • 0 / ^ / $ : begin of line, first non-blank, end of line
  • gg / G : top of file / end of file
  • x : delete character
  • dd / yy : delete line / yank (copy) line
  • p / P : paste after / before cursor
  • u / Ctrl+r : undo / redo
  • ~ : toggle case
  • /pattern + Enter : search forward
  • n / N : next / previous match
  • :%s/old/new/g : replace all in file (use c for confirm)
  • :w : write (save)
  • :q : quit
  • :wq or :x : save and quit
  • :q! : quit without saving
  • Use counts: 5j moves down 5 lines, 2dw deletes two words.
  • Combine commands: d$ deletes to end of line, caw changes a word.
  • Use registers: “ayyp stores a line into register a and pastes it.
  • Sessions and buffers: :e filename to open, :bn / :bp to cycle buffers.
  • ~/.vimrc (or init.vim for Neovim) holds your settings. Example minimal options: set number set expandtab set shiftwidth=2 set tabstop=2
  • Popular plugin managers: vim-plug, Vundle, Pathogen.

Further learning: vimtutor (run vimtutor in terminal) and practice small edits until motions become muscle memory.