Am I the only one who struggle with cmp comparators? I can’t make any setup to work like I want it to work.

Like come on, diagramIds is literally on the line above …

The comparators aren’t even documented: https://github.com/hrsh7th/nvim-cmp/issues/883

This is the closest thing I could find to usefull: https://github.com/hrsh7th/nvim-cmp/issues/183 but it didn’t help either

How did you manage to cope with this? Is there some reasonable setup for cmp comparators?

  • muntoo@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    Not sure if this helps, but here’s my ordering:

            sorting = {
              priority_weight = 2,
              comparators = {
                require("copilot_cmp.comparators").prioritize,
                compare.offset,
                compare.exact,
                compare.recently_used,
                compare.score,
                compare.scopes,
                compare.locality,
                compare.kind,
                compare.sort_text,
                compare.length,
                compare.order,
              },
            },
    

    …Realistically copilot is so good that it knows what the next word I’m completing is without even typing in a single character, so this doesn’t bother me like it used to.