Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

matcher_fuzzy should prioritize file name matching #495

Closed
dlee opened this Issue · 4 comments

2 participants

@dlee

When using matcher_fuzzy and sorter_rank, I think all the most relevant results end up at the bottom of the list.

I tend to type in file names for searching, but unite.vim prioritizes matches where the directories match the names instead of the files.

Is there a way to reverse this?

My .vimrc has these lines:

call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#custom#source('file_mru', 'matchers', ['matcher_project_files', 'matcher_fuzzy'])
@Shougo
Owner

You must use sorter_rank.

My .vimrc has these lines:

Where is sorter_rank?

I tend to type in file names for searching, but unite.vim prioritizes matches where the directories match the names instead of the files.

Plese show me the minimal .vimrc and the reproduceable ways from Vim starting.
I cannot reproduce it.

@dlee

Oops, I have this line as well:

call unite#custom#source('buffer,file,file_mru,file_rec,file_rec/async', 'sorters', 'sorter_rank')
@dlee

A common use case is when I have the following files among hundreds:

  • hello_there/hi.vim
  • hello_there.js
  • hello_there.vim

Typing he reduces the file list to the above three, but in this order:

  • hello_there.js
  • hello_there.vim
  • hello_there/hi.vim

My goal is to get to hello_there.vim, so I continue the matching by typing v to differentiate between hello_there.js and hello_there.vim.

However, now the list has changed so that the he portion matches the directory name with higher priority:

  • hello_there/hi.vim
  • hello_there.vim

The only way I can get hello_there.vim to come on top is by typing out the whole name. Instead, I would like hev to prioritize hello_there.vim over hello_there/hi.vim.

@Shougo
Owner

OK. But I don't want to change it. Pull request is well come.

You can change sorter_rank code. I have not much time.

https://github.com/Shougo/unite.vim/blob/master/autoload/unite/filters/sorter_rank.vim

@Shougo Shougo closed this
@dlee dlee referenced this issue
Merged

Add sorter_selecta #544

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.