When using vim to write code, I like to look at the definition of the structure in the header file while writing the implementation code, so that it is often used in multiple windows to edit, view the document.
1. Open multiple files at the same time and arrange horizontally
Vim-o t.c T.h
2, open multiple files at the same time after the vertical arrangement, if you do not use the parameter O, you can open the file after the operation
vim t.c t.h:all // Horizontal or: Vertical All // Portrait
3, the same file partition window. If there is a very long file (thousands of lines:)), you want to look at the front, to write the back, you need to use this
#在文件内: Split or: SP
4. Close the window
#关闭当前窗口: close# Keep the current window, close other windows: only
5. After opening a file, you want to open another file
#横向打开一个文件: SP file name # Portrait Opens a file: Vsplit (VSP) file name # Open a new window, note that this is not visible: New file Name # portrait opens it: Vnew file name
6. Jump between windows
CTRL +W J Move Down CTRL+W k up Move Ctrl+ whMove Ctrl + W L to the rightMove Ctrl +W t move to top CTRL +w b moving to the end
7. Mobile Window
#移动到最上面ctrl+w shift+k# move to the bottom ctrl+w shift+J # move to the leftmost ctrl+w shift+ h#move to the rightmost CTRL +w Shift+l
Vim's window switch