Understanding vi is essential for modifying configuration files, writing scripts, and managing servers when a graphical user interface is unavailable. The Architecture: Understanding vi Modes
The vi editor is a foundational visual text editor built into almost every Unix-like operating system. Originally created by Bill Joy in 1976, it remains a critical tool for system administrators and developers due to its lightweight nature and universal availability. vi command in linux
N — Repeats the previous search in the opposite direction. Global Search and Replace N — Repeats the previous search in the opposite direction
c — Append gc at the end to prompt for confirmation before each replacement. Summary Cheatsheet Key Binding Mode Required :q! Command-Line Save and exit :wq Command-Line Delete current line dd Copy current line yy Paste text p Go to line 1 gg Go to end of file G Undo last change u exrc or .vimrc configuration file ? Command-Line Save and exit :wq Command-Line Delete current
Activated from Command Mode by pressing specific letters (like i or a ).
/pattern — Searches forward through the document for the specified string.
Unlike modern text processors, vi is a modal editor. It operates in distinct modes, each changing how keys function. Navigating these modes is the key to mastering the editor. 1. Command Mode This is the default mode when opening a file. Keystrokes are interpreted as commands, not text.