mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-23 20:11:44 +00:00
disable cmp in comments
This commit is contained in:
parent
6f6ee89316
commit
680e5f69c1
@ -38,6 +38,16 @@ return {
|
||||
luasnip.config.setup {}
|
||||
|
||||
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_treesitter_capture 'comment' and not context.in_syntax_group 'Comment'
|
||||
end
|
||||
end,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
|
Loading…
Reference in New Issue
Block a user