Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to open multiple files at once from vim?

Tags:

vim

When launching vim from the command line, I can do for example vim *.txt to open all text files in a directory at once.

For some reason, trying the same from inside vim ( :e *.txt ) gives an error: E77: Too many file names.

Is there a reason why vim refuses to open multiple at once? Is there a way to change that?

like image 552
static_rtti Avatar asked Sep 06 '12 16:09

static_rtti


2 Answers

This should work :

:next *.txt
like image 65
William Pursell Avatar answered Oct 18 '22 11:10

William Pursell


It's done in two operations.

Open all *.js files in as many vertical splits:

:argadd *.js
:argdo vs

in horizontal splits:

:argdo sp

in tabs: 

:argdo tabe
like image 13
romainl Avatar answered Oct 18 '22 11:10

romainl