Tom Baker
Tom Baker

Reputation: 693

Lack of file explorer in Linux vim

In vim 7.3 on OSX, if I type

vim ~/myfiles

vim will put me into the Vim File Explorer for that directory, and I can open or rename files.

In vim 7.4 on Ubuntu, I get the unhelpful error message

"~/myfiles" is a directory

Looking through the compiled options (vim --version) and online documentation, I see no obvious way to activate this functionality through, say, a command-line or compile-time option. It is such a great feature of vim that I'm surprised it is not enabled on the version of vim available in the Linux package.

Upvotes: 0

Views: 1127

Answers (3)

Tom Baker
Tom Baker

Reputation: 693

To summarize and answer my own question...

File explorer functionality is actually provided by a plug-in, "netrw", which seems not to be installed by default in the two or three versions of vim I tried via apt-get.

Installing NERDTree solved the problem brilliantly - it can do so much more than the default explorer. I have not yet figured out how to rename a file using NERDTree - something that is easy with 'netrw', but that is a minor irritant and there is probably a way to do it.

Upvotes: 1

Ben
Ben

Reputation: 8905

The ability to edit a directory like this depends on a plugin. Most of the time, that plugin is the "netrw" plugin provided with Vim in the official runtime files. In Ubuntu (and Debian) you install that runtime separately so that every Vim package can use it rather than duplicating functionality. Try installing the vim-runtime package, and maybe a more feature-full Vim while you are at it, if you have not already done so.

Upvotes: 2

Don Reba
Don Reba

Reputation: 14051

Use the :E command for the explorer mode.

Upvotes: 2

Related Questions