From 91c2171da38d6ba0b81a4596742462fe1009e6e2 Mon Sep 17 00:00:00 2001 From: Sam Willcocks Date: Fri, 16 Dec 2022 16:26:34 +0000 Subject: [PATCH] vim: disable completions in comments also fancy borders --- home/vim-dev/dev.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/home/vim-dev/dev.lua b/home/vim-dev/dev.lua index a16c701..7139f59 100644 --- a/home/vim-dev/dev.lua +++ b/home/vim-dev/dev.lua @@ -12,9 +12,17 @@ end -- Completion local cmp = require'cmp' cmp.setup({ + -- Disable completions if we're in a comment + enabled = function() + if require"cmp.config.context".in_treesitter_capture("comment")==true or require"cmp.config.context".in_syntax_group("Comment") then + return false + else + return true + end + end, window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.complete(),