Open multiple files
Open multiple files on the horizontal direction:Â
Switch edit file:
Close all opened files without saving operation:
Multiple fails in the vertical direction:Â
Add a numberÂ
vim -o file1 file2 file3 ...
.Switch edit file:
ctrl + ww
.Close all opened files without saving operation:
qa
.Multiple fails in the vertical direction:Â
vim -O file1 file2 file3 ...
.Add a numberÂ
n
 after -o
, we can open multiple files in multiple split windows).Split window
Add a new split window on the horizontal direction:Â
Add a new split window on the vertical direction:Â
split
.Add a new split window on the vertical direction:Â
vsplit
Move the cursor between multiple windows
ctrl + w +Â Â
We can know thatÂ
Direction key
:Â Â Direction key
 contains h
, t
, k
, and l
, they refer to left, under, upper, and right directions respectively.We can know thatÂ
set mouse=a
 would make the window where the cursor on becomes editable status after we read vim’s help content. Save multiple files and exist
Bash
vim -O file1,file2,file3,...
# equal to
# vim -O `echo file{1,2,3,...}`
:wqall
Move the current window towards one special direction.
- Ctrl + w
- Shift +Â Â
Direction key
For example,Â
ctrl + w + K
 Can help us to put the current window on the top area.Edit in multiple tags
Create a new tab:Â
Close tab:Â
Retain only current tab:Â
abnew filename
.Close tab:Â
tabclose filename
.Retain only current tab:Â
tabonly