6

How can you open multiple files when you're already browsing one?

If I do:

:e myFile

then myFile open in another buffer, but obviously:

:e myFile1 myFile2

open a new file named "myFile1 myFile2"...

It's easily possible to open from outside, be it in tabs or buffer, but from inside, still did not find...

tshepang
  • 12,111
  • 21
  • 91
  • 136
benichka
  • 925
  • 1
  • 11
  • 32

2 Answers2

5

:e and its relatives only accept one argument. See :help :args:

:argadd myFile1 myFile2

or:

:next myFile1 myFile2

You can use wildcards too:

:argadd *.rb
romainl
  • 186,200
  • 21
  • 280
  • 313
0

you can use like this:

lets say you have opened one file using vim named a.c

now go to command mode. use sp (split) example:

:sp b.c

This should work for you. You can traverse through different files by pressing ctrl + (two times w)

jinal shah
  • 122
  • 4
  • Thank you! I knew the tab / split mode; it works but I wanted to open it directly into buffers without having to put it into another window / tab. – benichka Sep 20 '14 at 10:33