When I use netrw with the :Explore command I see that binary/executable files are highlighted in orange and have a little * start next to them, so I guess it can recognize them without having to rely on their extension.

How do I make netrw ignore executables files by default when it shows me the list of files in the current directory ?

1 Answer 1


netrw supports hiding entries in the list by allowing you to set a regular expression hiding list.

Slightly surprisingly, the pattern you set here is matched against the entire displayed entry which includes the * star you mention (rather than the actual file name), so you can set up an expression to look for entries that end with *:

let g:netrw_list_hide = '\*$'

With this in your .vimrc, vim should enter the hiding mode by default and will then display this in its banner:

"   Hiding:        \*$

You can press a to rotate through the three hiding modes: "show all", "show non-hidden", and "show hidden".

The simple expression above gets you 75% of the way there, matching executables in 3 out of netrw's 4 listing styles. However, the long listing includes even more information after the file's name, so something more complicated is required. A quick hack that is likely to work for almost all file names is to search for either the end of the line or for two spaces after the *:

let g:netrw_list_hide = '\*\($\|\s\s\)'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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