Auto commit: 2024-11-08 00:20:01

This commit is contained in:
Daniel Fichtinger 2024-11-08 00:20:01 -05:00
parent b56c191f85
commit a813b0038f

View file

@ -26,20 +26,14 @@ end
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown", pattern = "markdown",
callback = function() callback = function()
-- Enable concealment for inline and block math
vim.opt_local.conceallevel = 2
vim.opt_local.concealcursor = "nc"
-- Define regions for inline and block math to be treated as `tex`
vim.cmd([[ vim.cmd([[
syntax region texMathInline matchgroup=texMath start="\\$" skip="\\\\\\$" end="\\$" concealends syn region math start=/\$\$/ end=/\$\$/
syntax region texMathBlock matchgroup=texMath start="\\$\\$" end="\\$\\$" concealends " inline math
]]) syn match math '\$[^$].\{-}\$'
-- Set syntax highlighting for these regions to `tex` " actually highlight the region we defined as "math"
vim.cmd("highlight link texMath texMathZone") hi link math Statement
vim.cmd("highlight link texMathInline texMathZone") ]])
vim.cmd("highlight link texMathBlock texMathZone")
end, end,
}) })
vim.api.nvim_create_autocmd({ "FileType" }, { vim.api.nvim_create_autocmd({ "FileType" }, {