vim multi-window editing summary

1.
Open multiple windows The commands to open multiple windows are as follows:
Horizontal split window
: new + window name (the file name after saving)
: split + window name, which can also be abbreviated as: sp + window name
Vertical split window name
: vsplit + window The name can also be abbreviated as: vsp+window name
2. To close multiple windows,
you can use: q!, or you can use: close, the last window cannot be closed with close. Using close only temporarily closes the window, and its content is still in the cache. Only use q!, w! or x to really exit. : tabc
closes the current window : tabo
closes all windows Switch windows. 4. Window size adjustment Vertical adjustment : ctrl+w + vertical expansion (increase the number of lines) :ctrl+w - vertical reduction (the number of lines decreases) :res(ize) num For example: :res 5, the number of displayed lines is adjusted to 5 lines :res(ize)+num Increase the height of the current window by num lines :res(ize)-num Decrease the height of the current window by num lines Horizontal adjustment : vertical res(ize) num Specify the current window as num columns : vertical res(ize)+ num increases the current window by num columns : vertical res(ize)-num reduces the current window by num columns













5. Rename the window
: f file
6. vi open multiple files
vi abc
:n jump to the next file, you can also directly specify the file to be jumped, such as: nc, you can jump directly to the c file
: e# return to the edit just now file or: N
7. File browsing
: Ex Open the directory browser, you can browse all files in the current directory, and you can choose
: Sex to split the current window horizontally, and open the directory browser in one window
: ls Display the current buffer situation
8. Switch between vi and shell
: shell can switch to the shell command line without closing vi or:! shell command
: exit Return from the shell to vi

9. Display line number: set nu

10. Suppress display of line numbers :set nonu


Article reprint http://blog.csdn.net/devil_2009/article/details/7006113

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327076921&siteId=291194637