Can I use wildcards in netrw?

440 views Asked by At

I may be doing everything wrong and I have the feeling that the question I am asking is really basic but I cannot seem to find the answer anywhere.

When I browse a folder in order to open a file I do :e . and the current directory shows up. However I would like to filter the folder view by lets say just *.txt files. How can I get netrw to just show the *.txt files in that directory.

1

There are 1 answers

2
Randy Morris On BEST ANSWER

The easiest way to do this it seems is to open the browser however you wish (:e . works), then hit Ctrl-h. This will bring up a prompt that allows you to edit netrw's "ignore list". Here you can put a pattern like ".txt$". Once you enter the pattern, cycle through netrw's hide method using a while on the file tree.

This is a little clunky but after playing with it for a few minutes it's actually quite comfortable.

You'll definitely want to read up on the following help topics:

  • :help g:netrw_list_hide
  • :help netrw-ctrl-h
  • :help netrw-a