Disable autocomplete in comment
This commit is contained in:
parent
795552cf2e
commit
8301ce0039
|
@ -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')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user