mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 19:31:31 +00:00
nvim-cmp: move text and snippet completions to the bottom
This doesn't guarantee that snippets will be above text completions, but that should still be the case, since the `kind` comparator sorts snippets above text.
This commit is contained in:
parent
1604c7423f
commit
715408d2bd
2 changed files with 22 additions and 0 deletions
|
@ -42,6 +42,20 @@ in {
|
|||
after = ''
|
||||
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
||||
local cmp = require("cmp")
|
||||
|
||||
local kinds = require("cmp.types").lsp.CompletionItemKind
|
||||
local deprio = function(kind)
|
||||
return function(e1, e2)
|
||||
if e1:get_kind() == kind then
|
||||
return false
|
||||
end
|
||||
if e2:get_kind() == kind then
|
||||
return true
|
||||
end
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
cmp.setup(${toLuaObject cfg.setupOpts})
|
||||
|
||||
${optionalString config.vim.lazy.enable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue