Why does the :Explore command shows the . directory? This seems to be unnecessary as it's just one more line that I have to j.

Is there some way I can disable this?

  • I'm not sure to understand what you mean by "the :E explorer mode"? On my system it doesn't seems the a :E command exists: all I have is the :Explore command and it doesn't show a . directory. – statox Mar 11 '16 at 8:43
  • Yes, I do mean the :Explore command. So looks like there is something wrong with my vim or system settings. – Codename Mar 11 '16 at 8:49
  • 2
    Have you tried using Tim Pope's vinegar plugin? It really improves netrw behavior. I'm not sure it is what makes the . directory disappear but it is generally a good plugin to use if you use netrw. – statox Mar 11 '16 at 8:54
  • 1
    I can't answer the "how do I hide it"-part, but as for the "why"-part: it allows you to do operations on the current directory. Is this really that useful in netrw? Not really if you ask me. But that's probably the reason why it's there... – Martin Tournoij Mar 11 '16 at 9:29

You could hide the dot directory (./) by setting the global variables g:netrw_list_hide and g:netrw_hide in your vimrc like this:

let g:netrw_list_hide = '^\./$'
let g:netrw_hide = 1

The first variable can contain a comma separated list of regex patterns describing what you want to hide. Here, the pattern used is '^\./$':
a beginning of string (^), a literal dot \., a slash / and an end of string $.

You can also edit this variable from the file explorer netrw, by hitting <C-h>.

Once the variable is set, from netrw, hitting a will switch between different views:

  • showing everything
  • hiding items described by g:netrw_list_hide
  • only showing items in g:netrw_list_hide

You can configure which view is chosen by default by setting up g:netrw_hide which can take 3 values (0, 1 or 2).
1 means hiding by default the items in g:netrw_list_hide.

For more information, see:

:help g:netrw_list_hide
:help g:netrw_hide
| improve this answer | |
  • Just checked on a friends machine. I think it should be hidden and not even show up. I think I might have messed up some defaults. – Codename Mar 11 '16 at 9:16
  • Why are you deleting answers, saginaw? O.o OP just reposted this on Unix & Linux (unix.stackexchange.com/q/269307/70524), and going by that post, your current answer is what he's looking for. – muru Mar 12 '16 at 11:01
  • I thought the problem was in a default setting that was misconfigured and that the answer didn't solve the issue, sorry. – saginaw Mar 12 '16 at 11:09

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.