diff --git a/modules/programs/nvim/plugins/nvim-cmp.lua b/modules/programs/nvim/plugins/nvim-cmp.lua index 500a3a9..1a8a070 100644 --- a/modules/programs/nvim/plugins/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/nvim-cmp.lua @@ -76,6 +76,17 @@ cmp.setup.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 local cmp_autopairs = require("nvim-autopairs.completion.cmp")