nvim-config

Log | Files | Refs | README

commit 8cc3329671293c842215973c7aff7c348d904801
parent e66b3d28eb58b86ec704a6731cf9f02d781a5f76
Author: Thomas Vigouroux <me@vigoux.eu>
Date:   Wed,  4 Sep 2024 07:49:44 +0200

feat(latex): emph surround

Diffstat:
Mafter/ftplugin/tex.lua | 4++++
Mafter/queries/latex/textobjects.scm | 3+++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/after/ftplugin/tex.lua b/after/ftplugin/tex.lua @@ -295,6 +295,10 @@ vim.b.minisurround_config = { c = { input = surround_treesitter "@color", output = output_ask("Color name", "\\textcolor{%s}{", "}") + }, + i = { + input = surround_treesitter "@emph", + output = { left = "\\emph{", right = "}"} } } } diff --git a/after/queries/latex/textobjects.scm b/after/queries/latex/textobjects.scm @@ -19,3 +19,6 @@ ;; Colored text ((color_reference) @color.outer.from . (curly_group (_) @color.inner) @color.outer.to) ((_ (color_reference) @color.outer.from) . (curly_group (_) @color.inner) @color.outer.to) + +;; Emphasis +(((generic_command command: (_) @_emph arg: (curly_group (_) @emph.inner)) @emph.outer) (#eq? @_emph "\\emph"))