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

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

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
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Content Summary
: Input your strings, the tool can get a brief summary of the content for you.

X
0
Would love your thoughts, please comment.x
()
x