feat(nvim): disable cmp for IncRename

This commit is contained in:
Moritz Böhme 2023-09-07 08:45:50 +02:00
parent 116fc30524
commit 12a5420ee9
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -76,6 +76,17 @@ cmp.setup.cmdline(":", {
}, { }, {
{ name = "cmdline" }, { name = "cmdline" },
}), }),
enabled = function()
-- Set of commands where cmp will be disabled
local disabled = {
IncRename = true,
}
-- Get first word of cmdline
local cmd = vim.fn.getcmdline():match("%S+")
-- Return true if cmd isn't disabled
-- else call/return cmp.close(), which returns false
return not disabled[cmd] or cmp.close()
end,
}) })
-- If you want insert `(` after select function or method item -- If you want insert `(` after select function or method item
local cmp_autopairs = require("nvim-autopairs.completion.cmp") local cmp_autopairs = require("nvim-autopairs.completion.cmp")