commit cdf73a2998d0fbe0df6c3ad20c9c1ca946761e45
parent c321b41bfadb24a792422bf23bf44580b17bf0f8
Author: Thomas Vigouroux <me@vigoux.eu>
Date: Fri, 1 Mar 2024 11:31:14 +0100
feat(latex): env surround
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/after/ftplugin/tex.lua b/after/ftplugin/tex.lua
@@ -132,6 +132,15 @@ vim.b.minisurround_config = {
return { left = string.format("\\%s{", name), right = "}" }
end
+ },
+ e = {
+ input = surround.gen_spec.input.treesitter { outer = "@env.outer", inner = "@env.inner" },
+ output = function()
+ local name = surround.user_input("Env name")
+ if not name then return end
+
+ return { left = string.format("\\begin{%s}\n", name), right = string.format("\n\\end{%s}", name)}
+ end
}
}
}