Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use wildcards in netrw?

Tags:

vim

netrw

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.

like image 968
thequerist Avatar asked Sep 06 '25 03:09

thequerist


1 Answers

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
like image 153
Randy Morris Avatar answered Sep 08 '25 01:09

Randy Morris