summaryrefslogtreecommitdiff
path: root/after/plugin/autoclose.lua
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-18 00:58:26 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-18 00:58:28 +0200
commitcb36ccfa8db66db953795fd8e22138ed1712b1cd (patch)
treefc0f8ef4e73c5fa7fb627d383a991aeb49a59bca /after/plugin/autoclose.lua
parent424ad679f861031485e2e2f0ca19f5b559db929b (diff)
checkpoint
- added basic luasnip configuration - added highlights for TODO and FIXME keywords - added incremental selection of treesitter - added prettier to conform formatters - added when_disabled function to disable pairs in comments - changed the hiding keybind to :Hide command - only enable ` pairs in markdown - removed <c-k> keybind - removed cmp's calc source - renamed keybinds for consistency - reorganized plugins in lazy.lua
Diffstat (limited to 'after/plugin/autoclose.lua')
-rw-r--r--after/plugin/autoclose.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/after/plugin/autoclose.lua b/after/plugin/autoclose.lua
index b742fc6..1c912da 100644
--- a/after/plugin/autoclose.lua
+++ b/after/plugin/autoclose.lua
@@ -1,3 +1,14 @@
+local function in_comment()
+ if
+ require("cmp.config.context").in_treesitter_capture("comment") == true
+ or require("cmp.config.context").in_syntax_group("Comment")
+ then
+ return true
+ else
+ return false
+ end
+end
+
local filetypes = require("autoclose").setup({
keys = {
["("] = { escape = false, close = true, pair = "()" },
@@ -18,12 +29,13 @@ local filetypes = require("autoclose").setup({
close = true,
pair = "''",
disabled_filetypes = { "text", "telekasten", "groff", "diff", "gitcommit", "fugitive", "markdown" },
+ disabled_when = in_comment,
},
["`"] = {
escape = true,
close = true,
pair = "``",
- disabled_filetypes = { "text", "telekasten", "groff", "diff", "gitcommit", "fugitive" },
+ enabled_fileptypes = { "markdown" },
},
["*"] = { escape = true, close = true, pair = "**", enabled_filetypes = { "markdown" } },
["_"] = { escape = true, close = true, pair = "__", enabled_filetypes = { "markdown" } },