Using split is a way that user can open multiple documents in one vim session, but all the documents will be displayed in one display, split across the screen.
$ vim /etc/passwd
- to create vertical split and divide vim into 2 panels side by side, with the new panel opening /tmp/mylist
:vsp /tmp/mylist
- To create a horizontal split and divide vim into 2 parts, bottom and up, with the new panel opening a file called /tmp/mylist, use this command
:sp /tmp/mylist
- You can also create an empty buffer on the new horizontally split panel
:new
- And to create an empty buffer on the new vertically split panel
:vnew
- ctrl-w h or ctrl-w left arrow to move left
- ctrl-w j or ctrl-w down arrow to move down
- ctrl-w k or ctrl-w up arrow to move up
- ctrl-w l or ctrl-w right arrow to move right
- :q to close current panel
- :only to close other panels except the current one
- :qa to close all panels
- :qa! to force close all panels without saving
- ctrl-w + or ctrl-w - to increase or decrease the current panel's height
- ctrl-w > or ctrl-w < to increase or decrease the current panel's width
- ctrl-w _ to maximize the current panel's height
- ctrl-w | to maximize the current panel's width
- ctrl-w = to make the panels' width and height uniform
- vim -o file1 file2 to open file1 and file2 in horizontal split
- vim -O file1 file2 to open file1 and file2 in vertical split





