How to filter search results with Vertico

What happened?

+default/search-project doesn’t let me exclude certain file types or negate matches, like so:

image image image

What did you expect to happen?

+default/search-project should allow me to filter searches with more granularity.

Steps to reproduce

  1. SPC/ or SPCsp.
  2. Type in test !cd.
  3. See no results.

System information


Loading data dump...
2 Likes

Use ripgrep switches before or after --. E.g. #-t lua -- test or #test -- -t lua. I’ll use the latter for examples below.

  • To only search lua files: #test -- -t lua. Run $ rg --type-list for comprehensive list of types that Ripgrep supports.

  • To search any file that matches a glob: #test -- -g*.tar.gz

  • To search for test, but filter out results with cd in it, use consult’s sub-search feature: #test#!cd.

    • Everything before the second # is filtered by ripgrep.

    • Everything after the second # is filtered by Vertico using Orderless, where ! (negatation), = (literal), ~ (fuzzy), % (case insensitive) prefixes are supported.

    • The # delimiter can be replaced with any arbitrary character. E.g. %test%!cd or *test*!cd.

11 Likes

many thanks for you

another question

I want to find all Chinese in the project by regular expression

I try #-e [\u4e00-\u9fa5] or #-- -e [\u4e00-\u9fa5]

but not work
plz help me

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.