How do you open a file from within Vim?

:e <filename>

or

:Ex <directory>

lets you browse for the file from the given directory.

:Ex on its own will open the pwd.

:enew

will create an empty buffer.


Also, to open multiple files (or just one, so I tend to use this for opening a single file, since :e fails to open multiple files)

:n file1 file2

:n resets the argument list so it is as if you had entered them on the command line (so commands like :rew will work with this list), but :e does not.


this vim command you won't forget:

:Sex

if you want to point to certain dir, then :Sex <dir>

Tags:

Vi

Vim