1.1 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.1 KiB
		
	
	
	
	
	
	
	
title
| title | 
|---|
| Split | 
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.
Command Keys
The commands for creating a horizontal split:
:[N]split [file]
:[N]sp [file]
where sp is the short abbreviation for split.
The commands for creating a vertical split:
:[N]vsplit [file]
:[N]vs [file]
where vs is the short abbreviation for vsplit and...
- [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).
Examples
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.
- :spindex.htmlSplit the current window into equal horizontal windows and openindex.htmlin the new window.
- :vsmain.cssSplit the current window into equal vertical windows and openmain.cssin the new window.