8

When using Vim you can use :Explore to browser through files and folders.

Is there a simple way to start Vim in "Explore mode" from the terminal? Can I do this by just giving Vim some argument?

12

Alternatively (the passing of directory argument(s) as in @EvergreenTree's answer relies on the autocmds of the netrw plugin, and aren't a general solution), you can pass any Ex command to Vim on startup via the -c argument:

$ vim -c Explore

You can also use +, which is exactly the same as -c, except slightly shorter:

$ vim +Explore
10

The "Explore Mode" you are talking about is netrw, a vim plugin which is provided by default. It should open in that "mode" if you just try to open a directory with vim, eg. vim foo/bar/baz/

  • 3
    Thank you. So I guess the fastest way to do this is vim .. – Gonçalo Ribeiro Mar 9 '15 at 1:10
2

Try:

vim +Ex

It'll execute :Ex (:Explore) on vim startup to explore the current directory.

0

If

  • You're using gvim
  • Your vim supports +clientserver (see vim --version)

Then the following will allow you to simply type gvim (by itself) and get a browser display showing:

augroup VimStartup
au!
au VimEnter * if expand("%") == "" && argc() == 0 && (v:servername =~ 'GVIM\d*' || v:servername == "") | e . | endif
augroup END

(put this into your .vimrc)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.