What does vim do?

Vi IMproved — a modal terminal text editor.

▸ Explain your own vim command →

vim examples, explained

$ vim notes.txt

  • vimVi IMproved — a modal terminal text editor
  • notes.txtan argument passed to the command

$ vim -R config.yml

  • vimVi IMproved — a modal terminal text editor
  • -Ropen the file read-only (view mode)
  • config.ymlan argument passed to the command

$ vim -d old.txt new.txt

  • vimVi IMproved — a modal terminal text editor
  • -dstart in diff mode, like vimdiff
  • old.txtan argument passed to the command
  • new.txtan argument passed to the command

$ vim -O a.py b.py

  • vimVi IMproved — a modal terminal text editor
  • -Oopen the files in vertically split windows
  • a.pyan argument passed to the command
  • b.pyan argument passed to the command

vim flags & options

-Ropen the file read-only (view mode)
-mdisable modifications (writing is turned off)
-dstart in diff mode, like vimdiff
-oopen the files in horizontally split windows
-Oopen the files in vertically split windows
-popen the files in separate tabs
-uuse this config file instead of ~/.vimrc
-crun this Ex command after loading the first file
-Ssource this session/script file after loading
-estart in line-based Ex mode

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.