mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
Trying to disable autocomplete in comments
This commit is contained in:
parent
a8f736ba3a
commit
a221b0e725
1 changed files with 11 additions and 1 deletions
|
|
@ -59,6 +59,17 @@ end
|
|||
local luasnip = require("luasnip")
|
||||
|
||||
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,
|
||||
|
||||
mapping = {
|
||||
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
||||
-- if vim.fn.pumvisible() == 1 then
|
||||
|
|
@ -79,7 +90,6 @@ cmp.setup({
|
|||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue