How do I open several files in Vim, with each file in a separate

window/tab? You can use the -o and -O Vim command line arguments to open multiple files in separate horizontally or vertically split Vim windows. For example:

    $ vim -o3 f1.txt f2.txt f3.txt

The above command will open the files f1.txt, f2.txt and f3.txt in three separate horizontally split Vim windows.

    $ vim -O3 f1.txt f2.txt f3.txt

The above command will open the files f1.txt, f2.txt and f3.txt in three separate vertically split Vim windows.

    $ vim -p f1.txt f2.txt f3.txt

The above command will open the files f1.txt, f2.txt and f3.txt in three separate tab windows. The option ‘tabpagemax’ defines, how many tabpages can be opened at the same time, by default it is set to 10.

Comments (1)


Pepsh Pepshinsky

Let’s see you to :help viminfo-file-name (option -i) :set viminfofile=NONE


Speak Your Mind