When using the graphical versions of the open dialog (e.g. using :browse :e
command), vim will try to be clever and apply a filetype filter depending on your current filetype. So for a C file, it provides filter to only show C source files (*.c, *.cpp
) , or header files (*.h
) or a couple of other ones.
What Vim considers to be grouped together and shown to you in that dialog, can be customized by the browsefilter variable:
For MS Windows and GTK, you can modify the filters that are used in
the browse dialog. By setting the g:browsefilter or b:browsefilter
variables, you can change the filters globally or locally to the
buffer. The variable is set to a string in the format "{filter
label}\t{pattern};{pattern}\n" where {filter label} is the text that
appears in the "Files of Type" comboBox, and {pattern} is the pattern
which filters the filenames. Several patterns can be given, separated
by ';'.
If you want to disable this behavior, you can just empty the buffer-local variable b:browsefilter
:
:unlet! b:browsefilter
This could be done in an after-filetype plugin, e.g. for C filetype, add this line to a file called ~/.vim/after/ftplugin/c.vim
(create non-existing directories). See e.g. :h ftplugin-overrule, if you only want this for very few specific filetypes. If you want to globally disable it, you could use e.g. an BufEnter
autocommand (or similar ones).
b:browsefilter
variable