How can I open several files at once in Vim?

Viewed 22654

Is there a way to open all the files in a directory from within Vim? So a :command that would say in effect "Open all the files under /some/path into buffers".

Ideally, it would be great to open all the files under a dir recursively.

6 Answers

The command you are looking for is args:

For example:

:args /path_to_dir/*

will open all files in the directory

Did you try

:n /some/path/*

It will open all files in /some/path

I don't think it'll open file recursively though.

EDIT

Maybe using ** will open recursively as daf mentionned

Another way to open files recursively

find . -type f -exec vi {} \;
Related