Disable autocomplete in comment

This commit is contained in:
Dreaded_X 2022-01-29 04:13:03 +01:00
parent 795552cf2e
commit 8301ce0039

View File

@ -119,6 +119,19 @@ cmp.setup.cmdline(':', {
}) })
}) })
cmp.setup({
enabled = function()
-- disable completion in comments
local context = require 'cmp.config.context'
-- keep command mode completion enabled when cursor is in a comment
if vim.api.nvim_get_mode().mode == 'c' then
return true
else
return not context.in_syntax_group("Comment")
end
end
})
-- lsp setup -- lsp setup
local nvim_lsp = require('lspconfig') local nvim_lsp = require('lspconfig')