vimfileopendialog

gvim open dialog file type filter


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?


Solution

  • 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.