Horizontally
vim -o file1.txt file2.txt
Vertically
vim -O file1.txt file2.txt
You may optionally specify the number of splits to open. The following example opens two horizontal splits and loads file3.txt in a buffer:
vim -o2 file1.txt file2.txt file3.txt
You can open a new split within Vim with the following commands, in normal mode:
Horizontally:
:split <file name>
:new
Vertically:
:vsplit <file name>
:vnew
split will open the file in a new split at the top or left of your screen (or current split.) :sp and :vs are convenie...
You may sometimes want to change the size of a split or vsplit.
To change the size of the currently active split, use :resize <new size>. :resize 30 for example would make the split 30 lines tall.
To change the size of the currently active vsplit, use :vertical resize <new size>. :vert...
After you have opened a split window in vim (as demonstrated by many examples under this tag) then you will likely want to control windows quickly. Here is how to control split windows using keyboard shortcuts.
Move to split Above/Below:
Ctrl + w and k
Ctrl + w and j
Move to split Left/Right...
To move to split on left, use <C-w><C-h>
To move to split below, use <C-w><C-j>
To move to split on right, use <C-w><C-k>
To move to split above, use <C-w><C-l>