Vim
Vim (Vi Improved) is a powerful text editor with different modes for editing and commands.
| Command | Description |
|---|---|
vim file.txt | Open or create a file |
i | Enter insert (edit) mode |
Esc | Exit insert mode |
:w | Save changes |
:q | Quit |
:wq | Save and quit |
:q! | Quit without saving |
/word | Search for a word |
n | Go to next search match |
:%s/old/new/g | Replace all “old” with “new” |
Example:
vim notes.txt
Type i to start editing.
When finished, press Esc, then type :wq to save and exit.