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