I like using the file browser in gvim sometimes, however what I don't like is that the file filter is always set to the current file type being edited.
For example, if I have a .cpp file open in the current buffer and go to the file open dialog the file filter is set to "C++ source files (*.cpp *.c++)". I would prefer that headers are displayed too by default (say).
Is there a way to change this default behavior?
Thanks to @benjifisher, I found the help for :browse
which shows how to do what I wanted.
More specifically, the default filetype plugin for C/C++ contains these lines:
let b:browsefilter = "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" .
\ "C Header Files (*.h)\t*.h\n" .
\ "C Source Files (*.c)\t*.c\n" .
\ "All Files (*.*)\t*.*\n"
I copied the file into my local vim ftplugin
directory and modified to my liking which now takes precedence over the system version.
If anyone, like me, wants a quick and simple way to disable this behaviour altogether in vimrc:
autocmd FileType * let b:browsefilter = ''
From first reply in this thread
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With