[vim/vim] ins-completion(fuzzy sorting): give opt to allow fuzzy sorting when the completion menu first opens (Issue #18488)

19 views
Skip to first unread message

ddad431

unread,
Oct 4, 2025, 11:18:12 AM (3 days ago) Oct 4
to vim/vim, Subscribed
ddad431 created an issue (vim/vim#18488)

Add immedsort(whatever name) for completeopt to allow fuzzy sorting when the completion menu first opens.

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
Currently, fuzzy sorting doesn't occur when the completion menu first opens. From @girishji mentioned in #17469, this appears to be deliberately designed.

The current design is acceptable with autocomplete enabled. However, for users who prefer manual completion, the fuzzy completion experience is much worse compared to before prefix completion.

It is possible to write Vimscript to bypass this issue. But, this is not something the user should have to consider, as adding this new option is merely a compromise regarding the previous non-mainstream fuzzy completion design.

In summary:

  • Avoid the counterintuitive design under the current compromise.
  • Reduce the friction for users to transition from prefix completion to fuzzy completion.
  • User-friendly, users do not need to write Vimscript.

Describe the solution you'd like

set cot+=immedsort

Describe alternatives you've considered

" Temporary solution 
function! s:self_inscompletion_ctrl_n()
    let curpos = col('.')
    let beforechar = (curpos > 1) ? getline('.')[curpos - 2] : ''
    let prebeforechar = (curpos > 2) ? getline('.')[curpos - 3] : ''
    if pumvisible()
        return "\<Down>"
    endif
    if curpos <= 2 || prebeforechar == ' '
        return "\<C-n>"
    endif
    return "\<C-n>\<BS>" .. beforechar
endfunction

Additional context


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18488@github.com>

girish

unread,
Oct 4, 2025, 11:36:28 AM (3 days ago) Oct 4
to vim/vim, Subscribed
girishji left a comment (vim/vim#18488)

Will this help: :set completefuzzycollect=keyword?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18488/3368361934@github.com>

ddad431

unread,
Oct 4, 2025, 12:21:25 PM (3 days ago) Oct 4
to vim/vim, Subscribed
ddad431 left a comment (vim/vim#18488)

Will this help: :set completefuzzycollect=keyword?

No help.

Video

https://github.com/user-attachments/assets/fa7d0cb1-5a7a-4e36-816f-259b02d1d994


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18488/3368390025@github.com>

girish

unread,
Oct 4, 2025, 3:10:04 PM (3 days ago) Oct 4
to vim/vim, Subscribed
girishji left a comment (vim/vim#18488)

I think the menu items should be sorted from the start — it just feels off when they aren’t sorted as soon as the user types a letter.
@habamax, didn’t you post discussion about fuzzy collection vs. filtering? Do you have the link to that?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18488/3368483667@github.com>

Maxim Kim

unread,
Oct 4, 2025, 8:14:18 PM (3 days ago) Oct 4
to vim/vim, Subscribed
habamax left a comment (vim/vim#18488)

I can only recall discussions around completefuzzycollect, and I agree that if fuzzy is enabled it should be applied everywhere where fuzzy makes sense/possible to implement.

But apparently there were ppl who prefers fuzzy to filter only, not for candidates collection.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18488/3368621448@github.com>

girish

unread,
Oct 5, 2025, 3:13:56 AM (2 days ago) Oct 5
to vim/vim, Subscribed
girishji left a comment (vim/vim#18488)

Maybe the old fuzzy algorithm was the issue.

This sounds intuitive to me:

  • cot=fuzzy means candidates are gathered and sorted by fuzzy score by default.
  • If someone prefers non-fuzzy collection, they can do :set cfc=.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18488/3368814367@github.com>

Maxim Kim

unread,
Oct 5, 2025, 3:17:03 AM (2 days ago) Oct 5
to vim/vim, Subscribed
habamax left a comment (vim/vim#18488)

Maybe the old fuzzy algorithm was the issue.

This sounds intuitive to me:

* `cot=fuzzy` means candidates are gathered and sorted by fuzzy score by default.

* If someone prefers non-fuzzy collection, they can do `:set cfc=`.

That is the way I prefer too.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18488/3368815795@github.com>

Christian Brabandt

unread,
Oct 6, 2025, 3:10:28 PM (20 hours ago) Oct 6
to vim/vim, Subscribed

Closed #18488 as completed via 10aa04e.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/18488/issue_event/20124053105@github.com>

Reply all
Reply to author
Forward
0 new messages