Open multiple files

Open multiple files on the horizontal direction: 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: split.
Add a new split window on the vertical direction: vsplit

Move the cursor between multiple windows

ctrl + w +  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

vim -O file1,file2,file3,...  
# equal to
# vim -O `echo file{1,2,3,...}`

Move the current window towards one special direction.

  1. Ctrl + w
  2. 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: abnew filename.
Close tab: tabclose filename.
Retain only current tab: tabonly
Categories: Vim

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments

XOR Strings
: Input your strings, the tool can encrypt and decrypt them.

Would love your thoughts, please comment.x