How to open files in vertically/horizontal split windows in Vim from the command line
I'm assuming you mean from the command line. From vim --help
:
-o[N] Open N windows (default: one for each file)
-O[N] Like -o but split vertically
So type this to open files split horizontally, for example:
vim -o file1.txt file2.txt file3.txt
Ctrl+W, S (upper case) for horizontal splitting
Ctrl+W, v (lower case) for vertical splitting
Ctrl+W, Q to close one
Ctrl+W, Ctrl+W to switch between windows
Ctrl+W, J (xor K, H, L) to switch to adjacent window (intuitively up, down, left, right)