Skip to content

Fuzzy completion in insert mode broken in Homebrew and source-built Vim on macOS #17576

Description

@zhuxy-astro

Steps to reproduce

  1. Install vim using homebrew or build from source on macOS.
  2. Run vim -Nu NONE test.txt and then :set completeopt=menu,fuzzy
  3. In the insert mode, type iostream fstream strm, and then hit CTRL-P.
  4. Error "Pattern not found" is thrown.

The strange thing is that, the bug appears in both the Homebrew-installed version and the version built from source, but not in the macOS built-in /usr/bin/vim! The Homebrew version includes all the features of the built-in version and is more up-to-date, yet the built-in version works correctly while the others throw an error. I have no idea why this happens.

I have attempted to build Vim from source twice:

  1. Using ./configure --prefix=$HOME/.local
  2. Using ./configure --with-features=huge --enable-python3interp --prefix=$HOME/.local

Fuzzy completion fails in both cases.

Expected behaviour

A menu should pop up with two choices to select, and iostream should be in the line.

Version of Vim

9.1.1450 (the Homebrew version. See details below.)

Environment

Operating System: macOS Sequoia 15.5.
Terminal: macOS built-in Terminal.app.
$TERM: xterm-256color
Shell: zsh 5.9 (arm64-apple-darwin24.0)

Logs and stack traces

For your reference, below are the versions of the macOS built-in Vim, the Homebrew-installed version, and the source-built version:

  1. The macOS built-in Vim, where the fuzzy completion works fine:
/usr/bin/vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Apr 18 2025 23:20:17)
macOS version - arm64
Included patches: 1-754
Compiled by [email protected]
Normal version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
-arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
-balloon_eval_term -gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     -perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        -vartabs
+clipboard         -keymap            +printer           +vertsplit
+cmdline_compl     +lambda            -profile           +vim9script
+cmdline_hist      -langmap           -python            +viminfo
+cmdline_info      +libcall           -python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          -rightleft         +vreplace
+cscope            +localmap          -ruby              +wildignore
+cursorbind        -lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xattr
-dnd               -mouseshape        +spell             -xfontset
-ebcdic            +mouse_dec         +startuptime       -xim
-emacs_tags        -mouse_gpm         +statusline        -xpm
+eval              -mouse_jsbterm     -sun_workshop      -xsmp
+ex_extra          +mouse_netterm     +syntax            -xterm_clipboard
+extra_search      +mouse_sgr         +tag_binary        -xterm_save
-farsi             -mouse_sysmouse    -tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa 
  1. The Homebrew version, where fuzzy completion won't work:
/opt/homebrew/bin/vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jun 10 2025 18:31:44)
macOS version - arm64
Included patches: 1-1450
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_old_static
+arabic            +find_in_path      +mouse_xterm       -tag_any_white
+autocmd           +float             +multi_byte        -tcl
+autochdir         +folding           +multi_lang        +termguicolors
-autoservername    -footer            -mzscheme          +terminal
-balloon_eval      +fork()            +netbeans_intg     +terminfo
+balloon_eval_term +gettext           +num64             +termresponse
-browse            -hangul_input      +packages          +textobjects
++builtin_terms    +iconv             +path_extra        +textprop
+byte_offset       +insert_expand     +perl              +timers
+channel           +ipv6              +persistent_undo   +title
+cindent           +job               +popupwin          -toolbar
-clientserver      +jumplist          +postscript        +user_commands
+clipboard         +keymap            +printer           +vartabs
+cmdline_compl     +lambda            +profile           +vertsplit
+cmdline_hist      +langmap           -python            +vim9script
+cmdline_info      +libcall           +python3           +viminfo
+comments          +linebreak         +quickfix          +virtualedit
+conceal           +lispindent        +reltime           +visual
+cryptv            +listcmds          +rightleft         +visualextra
+cscope            +localmap          +ruby              +vreplace
+cursorbind        +lua               +scrollbind        +wildignore
+cursorshape       +menu              +signs             +wildmenu
+dialog_con        +mksession         +smartindent       +windows
+diff              +modify_fname      +sodium            +writebackup
+digraphs          +mouse             +sound             -X11
-dnd               -mouseshape        +spell             -xattr
-ebcdic            +mouse_dec         +startuptime       -xfontset
+emacs_tags        -mouse_gpm         +statusline        -xim
+eval              -mouse_jsbterm     -sun_workshop      -xpm
+ex_extra          +mouse_netterm     +syntax            -xsmp
+extra_search      +mouse_sgr         +tabpanel          -xterm_clipboard
-farsi             -mouse_sysmouse    +tag_binary        -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/opt/homebrew/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang -o vim -lm -lncurses -lsodium -liconv -lintl -framework AppKit -L/opt/homebrew/opt/lua/lib -llua5.4 -fstack-protector-strong -L/System/Library/Perl/5.34/darwin-thread-multi-2level/CORE -lperl -L/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.13/lib/python3.13/config-3.13-darwin -lpython3.13 -framework CoreFoundation -lruby.3.4 -L/opt/homebrew/Cellar/ruby/3.4.4/lib
  1. The version built from source with ./configure --with-features=huge --enable-python3interp --prefix=$HOME/.local, which the fuzzy completion still won't work:
/Users/zhuxy/.local/bin/vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jun 19 2025 22:14:47)
macOS version - arm64
Included patches: 1-1471
Compiled by zhuxy@bogon
Huge version without GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_old_static
+arabic            +find_in_path      +mouse_xterm       -tag_any_white
+autocmd           +float             +multi_byte        -tcl
+autochdir         +folding           +multi_lang        +termguicolors
-autoservername    -footer            -mzscheme          +terminal
-balloon_eval      +fork()            +netbeans_intg     +terminfo
+balloon_eval_term -gettext           +num64             +termresponse
-browse            -hangul_input      +packages          +textobjects
++builtin_terms    +iconv             +path_extra        +textprop
+byte_offset       +insert_expand     -perl              +timers
+channel           +ipv6              +persistent_undo   +title
+cindent           +job               +popupwin          -toolbar
-clientserver      +jumplist          +postscript        +user_commands
+clipboard         +keymap            +printer           +vartabs
+cmdline_compl     +lambda            +profile           +vertsplit
+cmdline_hist      +langmap           -python            +vim9script
+cmdline_info      +libcall           +python3           +viminfo
+comments          +linebreak         +quickfix          +virtualedit
+conceal           +lispindent        +reltime           +visual
+cryptv            +listcmds          +rightleft         +visualextra
-cscope            +localmap          -ruby              +vreplace
+cursorbind        -lua               +scrollbind        +wildignore
+cursorshape       +menu              +signs             +wildmenu
+dialog_con        +mksession         +smartindent       +windows
+diff              +modify_fname      +sodium            +writebackup
+digraphs          +mouse             +sound             -X11
-dnd               -mouseshape        +spell             -xattr
-ebcdic            +mouse_dec         +startuptime       -xfontset
+emacs_tags        -mouse_gpm         +statusline        -xim
+eval              -mouse_jsbterm     -sun_workshop      -xpm
+ex_extra          +mouse_netterm     +syntax            -xsmp
+extra_search      +mouse_sgr         +tabpanel          -xterm_clipboard
-farsi             -mouse_sysmouse    +tag_binary        -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/Users/zhuxy/.local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -I/opt/homebrew/Cellar/libsodium/1.0.20/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -L/opt/homebrew/Cellar/libsodium/1.0.20/lib -lsodium -liconv -framework AppKit -L/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12/lib/python3.12/config-3.12-darwin -lpython3.12 -framework CoreFoundation

Activity

  1. girishji commented on Jun 19, 2025

    @girishji
    Contributor

    Could you try :set completefuzzycollect=keyword and see if that helps?

    I'm not sure why this option is empty by default. It’s a new option, and it seems to be more confusing than helpful.

  2. habamax commented on Jun 19, 2025

    @habamax
    Contributor

    See #15295 and #16032

  3. girishji commented on Jun 20, 2025

    @girishji
    Contributor

    See #15295 and #16032

    After reviewing those links, it seems this issue is wrongly decided. The completefuzzycollect option likely shouldn't exist — the distinction between "collection" and "filtering" is an internal implementation detail, and users shouldn't need to be aware of it. The longest value can be made to work without introducing this new option. Moreover, the default value of the new option is incorrect—as it stands, but changing it would break the longest functionality!

  4. zhuxy-astro commented on Jun 20, 2025

    @zhuxy-astro
    Author

    Could you try :set completefuzzycollect=keyword and see if that helps?

    I'm not sure why this option is empty by default. It’s a new option, and it seems to be more confusing than helpful.

    Thank you so much. Setting this makes everything work. Therefore I'm closing this issue.

    See #15295 and #16032

    After reviewing those links, it seems this issue is wrongly decided. The completefuzzycollect option likely shouldn't exist — the distinction between "collection" and "filtering" is an internal implementation detail, and users shouldn't need to be aware of it. The longest value can be made to work without introducing this new option. Moreover, the default value of the new option is incorrect—as it stands, but changing it would break the longest functionality!

    I glanced through the links and felt overwhelmed by the complexity of the discussion. I’m not sure whether the completefuzzycollect option should exist or not, but I totally agree that it should either be enabled by default, or that the necessity turning it on should be stated more explicitly in the documents. A general user like me should be able to get fuzzy completion working without spending an hour trying to understand the difference between "fuzzy collect" and "fuzzy filter".

  5. chrisbra commented on Jun 20, 2025

    @chrisbra
    Member

    After reviewing those links, it seems this issue is wrongly decided. The completefuzzycollect option likely shouldn't exist — the distinction between "collection" and "filtering" is an internal implementation detail, and users shouldn't need to be aware of it. The longest value can be made to work without introducing this new option. Moreover, the default value of the new option is incorrect—as it stands, but changing it would break the longest functionality!

    I don't think this is an implementation detail. Fuzzy itsself does not really have a clear meaning, it's a bit - well - fuzzy :)
    But one needs to be aware, there are 2 parts of it:

    • one how Vim is collecting/gathering all the matches to be displayed in the pum
    • one how Vim will be doing the filtering of further matches

    I don't think we can (or should) decide how this should be done. In my opinion, that seems to be a clear decision that each user (that wants to use fuzzying matching) needs to be aware of and needs to decide on their own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions