macvim-dev / macvim-dev/macvim

RFC: support filetype selection in gui open window and consider b:browsefilter

Open
#761 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

:h browsefilter says

							*browsefilter*
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 ';'.

LibreOffice (tested with v6.1) under macOS supports similar functionality.

Could MacVim support this as well and take b:browsefilter into account?

There are 52 filetype plugins in $VIMRUNTIME which define b:browsefilter.

❯ ag -l browsefilter | wc -l
      52

I noticed that many macOS apps gray out those filetypes they do not support in the open file dialog window but do not provide a pulldown menu to change the filter.

If this is more complicated to implement (non-standard open dialog window), feel free to close this issue since this is not very important for me.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with :h browsefilter and the MacVim GUI open-window implementation, then inspect the filetype plugins that define b:browsefilter. Done means the macOS open dialog supports filetype selection and accounts for buffer-local b:browsefilter values.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, vim
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.