Vim Tutorial: Installation, Modes, and Basic Commands
Vim Introduction
In my opinion, Vim is the most convenient editor on Linux.
1. Installation by Operating System
Install it in your terminal:
# Ubuntu / Debian / Mint |
2. VIM has four common modes:
- Normal mode
- Insert mode
- Command mode
- Visual mode
2.1 Commands you can use in normal mode
i Enter insert mode |
2.2 Things you can do in command mode
Backspace Return to normal mode |
Replace
Replace on current line
:s/old/new/ Replace first "old" on current line |
Replace in entire file
:%s/old/new/g Replace all in file |
Replace in specific lines
:1,10s/old/new/g Replace from line 1 to line 10 |
3. Quick Example
vim Text |
If Text exists in the current directory, Vim opens it. If not, Vim creates and opens it.
After opening, Vim starts in normal mode.
Press i to enter insert mode and type content.
Then press Esc to return to normal mode.
Save and quit with:
:wq |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Comments



