Opening Files in Vim with Split
In Vim, files can be opened or
split horizontally and vertically to create an additional window or viewport for a given file.
The commands for creating a horizontal split:
sp is the short abbreviation for
The commands for creating a vertical split:
vs is the short abbreviation for
[N]is the height (defaults to half current window).
[file]is the file to open in the new split window (current file used if none given).
Some examples of using split in Vim:
spSplit the current window into equal horizontal windows for the current file.
10spSplit the current window creating a new window with height 10 for the current file.
index.htmlSplit the current window into equal horizontal windows and open
index.htmlin the new window.
main.cssSplit the current window into equal vertical windows and open
main.cssin the new window.