ChasingZenith / treesitter_latex_mathmode.nvim

Uses treesitter to expose "in_mathmode()" function for latex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

treesitter_latex_mathmode.nvim

Uses treesitter to expose "in_mathmode()" function for latex.

Source

I found the code in this comment.

Usage

Put this in your tex.snippets file.

global !p
def math():
	return vim.eval('mode#in_mathzone()') == '1'

...
endglobal

To restrict a snippet to mathmode, use

context "math()"
snippet iff "iff" Ai
\iff
endsnippet

About

Uses treesitter to expose "in_mathmode()" function for latex

License:MIT License


Languages

Language:Lua 91.6%Language:Vim Script 8.4%