Vim—vi Improved
Vim is the most powerful and most popular of the vi clones currently in use. It is the default version of vi on most GNU/Linux systems.
Important Command-Line Options
-bStart in binary mode.
-ccommandExecute command at startup (POSIX version of the historical
+command).
-CRun in vi compatibility mode.
-fFor the GUI version, stay in the foreground.
-gStart the GUI version of Vim, if Vim was compiled with support for the GUI.
-iviminfoRead the given viminfo file for initialization instead of the default viminfo file.
-o[N]Open N windows, if given; otherwise, open one window per file.
-O[N]Like
-o, but split the windows vertically.
-nDon’t create a swap file: recovery won’t be possible.
-pOpen a new tab for each file named on the command line.
-qfilenameTreat filename as the “quick fix” file.
-RStart in read-only mode, setting the
readonlyoption.-sEnter batch (script) mode. This is only for ex and intended for running editing scripts (POSIX version of the historical “–” argument).
-uvimrcRead the given .vimrc file for initialization and skip all other normal initialization steps.
-UgvimrcRead the given .gvimrc file for GUI initialization and skip all other normal GUI initialization steps.
-yEnter “easy” mode, which provides more intuitive behavior for beginners.
-ZEnter restricted mode (same as having a leading
rin the name).
Vim Window Management
Vim lets you split the screen into multiple windows and control their size and placement.
Window management commands—ex
Command | Function ... |
|---|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access