ArticleDirectory
This article mainly teaches you how to use the vim split screen function
Split screen to start Vim
- Use uppercase o ParametersUp/downSplit the screen.
Vim-on file1 file2...
- Use the lower-case o ParameterLeft and rightSplit the screen.
Vim-on file1 file2...
Note:N is a number, which indicates several screens.
Disable Split screen
- Close the current window.
CTRL + W C
- Close the current window. If only the last one is left, exit vim.
CTRL + w Q
Split screen
- Splits open files up and down.
CTRL + W S
- Split up and down, and open a new file.
: SP filename
- Split the currently opened files left and right.
CTRL + W v
- Split left and right, and open a new file.
: VSP filename
Move cursor
The cursor keys in VI are H, J, K, and L. to switch between screens, just press Ctrl + W.
- Move the cursorRight side.
CTRL + W L
- Move the cursorLeft.
CTRL + W H
- Move the cursorAbove.
CTRL + W K
- Move the cursorBottom.
CTRL + w j
- Move the cursorNext..
CTRL + W
Mobile split screen
This function still uses the vim optical key, which is only in uppercase. Of course, if your split screen is messy and complicated, this function may have some very strange symptoms.
- Move to the right.
CTRL + W L
- Move to left
CTRL + W H
- Move up
CTRL + W K
- Move down
CTRL + w j
Screen Size
The following are some operations to change the size, mainly the height. You can use Ctrl + W <or> for the width, but this may be supported by the latest version.
- Make all screens have the same height.
CTRL + W =
- Increase the height.
CTRL + W +
- Reduce height.
CTRL + w-
Maybe there are other things I don't know. Please add them.
Recommendation reference:
Summary of common Vim commands
Vim editingCodeTips