I've been using [Neo]vim for a few months now with a number of plugins. One I decided to use was the built in :Explore for my file-browsing needs.

I am having some serious issues with Explore and need some help in resolving (or tell me if it is normal).

Note that the below issues happen in both vim and Neovim.

Ghost Buffers opening based on text clicked

With mouse-mode enabled, using :Vex to open vertical explore and the focus of the window is in the Explorer window, if I use the mouse to click into a window/buffer of an already opened file and I click a line of code:

  1. A new blank buffer opens.
  2. The name of the buffer is the contents of the line I entered, in the form of ^Irun.Proxy() (the line of code I clicked on had run.Proxy().
  3. The Explore window now is blank/empty with no history.

Resolution is to close the empty buffer (which, without a plugin to close the buffer without closing the window is a PITA), close the window for the Explorer, re-open Explorer (and split, again, if I had to close the window).

Very annoying.

Lanching :Vex from a buffer of a sub-directory opens invalid file

This is not repeatable all the time... But it does happen.

Launch vim from a project root folder, like:

cd ~/code/projectA/

Now, open a file from a sub-directory:

:e sub-folder/file.go

Now launch :Vex and Explorer starts from that sub-directory because the current buffer is locates in sub-folder/. Ok, not a big issue. I select .. in Explorer to backup to the project root.

Here's the issue: from this same :Vex window, if I open a file now at the project root, say main.go, what opens is a buffer to a file located at sub-folder/main.go instead of the file I selected in Explorer. this buffer is blank.

BUT... if I close that buffer, change focus back to Explorer and select main.go again, now the correct file opens in a buffer.

Very annoying.

Explorer inconsistent in keeping sub-folders open

Say I have :Vex open with 3 sub-folders open. Once I switch to a buffer and edit/save a file, if I switch back to the existing :Vex that I still have open and select any other sub-folder:

  1. The last sub-folder I opened collapses. Often times, it is even the sub-folder I am in and I want to open yet a deeper sub-folder.
  2. The sub-folder I selected does not open.

What happens is I have to re-open the sub-folders I previously had opened. But, not all. Some reopen expanded.

I have no found any way to have Explore retain its own state of open folders, let me switch to Explorer and explore further down the directory tree, without it collapsing everything else.

Very annoying.


Those are the biggest issues I have with Explore and it is seriously affecting my vim mojo.

Last week I was code-pairing with a colleague and it horribly apparent how messed up this is. I've been getting so used to working around this issues that when he saw all of these issues, he was so turned off from ever trying vim in the future. "I heard vim was pretty good; but wow, that's horrible man. I couldn't stand it."

Please tell me if this is common, in which case I'll switch to Nerdtree or alike. Or, if this is just my setup. In which case, how I would I debug?

Using latest versions of vim and neovim from Homebrew.

  • 7
    The default file explorer is indeed buggy (and from what I've read it has more or less always been). Tim pope wrote the vinegar plugin to improve it a little bit but it's still not perfect (I'm really not sure it would solve your problems). About Nerdtree, I used it, but it also have some annoying bugs (some buffers which doesn't close when they should and this kind of stuff). I would recommend to get used to functions like :find, :e, :buffers to get ride of file explorers. Some will also advise to use fuzzy finders (but I'm not of these ones). – statox Apr 27 '16 at 7:25
  • 1
    thanks @statox! yeah, I've spent hours disabling most of my plugins and trying different plugins in hopes that it was one of my plugins. but it's good (and bad) to hear that it is very buggy. that's annoying and basically is turning me off of vim: I have to do a lot of code discovery in my job, which I work best by visualizing the directory tree and naming conventions of the group of files. Hence, :Vex and keeping it open with about a dozen buffers in another split view (sometimes 4 splits at once in a 2x2 pattern). – eduncan911 Apr 27 '16 at 12:37
  • 1
    Well @eduncan911 I understand that, I also was used to the "traditional file explorer view" with your directory and your files but really it is just a question of habit: I got used to navigate in my file in another way and now it's just not a problem anymore (Still I've been using Nerdtree for something like a year so it took time to make the change). In my opinion Vim provides a many useful and efficient features that it is worth getting used to another way to browse your files :-) – statox Apr 27 '16 at 13:05
  • 3
    Also I think this is a relevant article: [Oil and vinegar - split windows and the project drawer ](vimcasts.org/blog/2013/01/…) – statox Apr 27 '16 at 13:07
  • Can all this be reproduced with no .vimrc file, no plugins etc? (It's not clear from your comment about if you tried this) – user859 Feb 22 '17 at 15:37
  • May I suggest that you try the latest version of netrw: v157b, which you may get from http://www.drchip.org/astronaut/vim/index.html#NETRW.
  • Ghost buffers -- unable to duplicate
  • Launching... Are you using the acd option? What netrw options are you using; in particular, what is g:netrw_keepdir? I've tried the procedure you mentioned five times now and never had the problem you had
  • Explorer inconsistent... Tried with three subfolders open, all just one level in, did a split, edit, save, switch to netrw -- no unwanted closures occurred. Tried with with three nested subfolders open, did a split, edit, save, switch to netrw -- no unwanted closures occurred.
| improve this answer | |

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