vim is a powerful text editor preferred by experienced Linux users.
Open a File
vim filename.txtModes
- Normal mode — default mode for navigation and commands
- Insert mode — press
ito enter, type text - Command mode — press
:for commands
Essential Commands
i # Enter insert mode
Esc # Return to normal mode
:w # Save
:q # Quit
:wq # Save and quit
:q! # Quit without saving
dd # Delete line
yy # Copy line
p # Paste
u # Undo
/search # Search for text
n # Next search resultQuick Edit and Save
The fastest workflow: vim file → i → make changes → Esc → :wq