Auto commit: 2024-11-08 00:05:01
This commit is contained in:
parent
3cd39e4ad4
commit
5446ebfdc5
1 changed files with 17 additions and 5 deletions
|
@ -5,15 +5,27 @@
|
||||||
vim.opt_local.breakindent = true
|
vim.opt_local.breakindent = true
|
||||||
vim.opt_local.wrap = true
|
vim.opt_local.wrap = true
|
||||||
local md_tex = function()
|
local md_tex = function()
|
||||||
vim.cmd("syn region markdownMathInline matchgroup=texMathZone start=/$/ end=/$/ contains=@texMath")
|
-- vim.cmd("syn region markdownMathInline matchgroup=texMathZone start=/$/ end=/$/ contains=@texMath")
|
||||||
vim.cmd("syn match markdownMathInline '$[^$].{-}$' contains=@texMath")
|
-- vim.cmd("syn match markdownMathInline '$[^$].{-}$' contains=@texMath")
|
||||||
vim.cmd("syn region markdownMathBlock matchgroup=texMathZone start=/$$/ end=/$$/ contains=@texMath")
|
-- vim.cmd("syn region markdownMathBlock matchgroup=texMathZone start=/$$/ end=/$$/ contains=@texMath")
|
||||||
vim.cmd("syn include @texMath syntax/tex.vim")
|
-- vim.cmd("syn include @texMath syntax/tex.vim")
|
||||||
|
-- Include the tex syntax for use within markdown
|
||||||
|
vim.cmd("syntax include @tex syntax/tex.vim")
|
||||||
|
|
||||||
|
-- Define the inline math region and allow it to contain tex syntax
|
||||||
|
vim.cmd("syntax region texMathZone start=/\\$/ end=/\\$/ contained contains=@tex")
|
||||||
|
|
||||||
|
-- Define the display math region and allow it to contain tex syntax
|
||||||
|
vim.cmd("syntax region texMathDisplay start=/\\$\\$/ end=/\\$\\$/ contained contains=@tex")
|
||||||
|
|
||||||
|
-- Optionally, conceal the `$` symbols for cleaner display
|
||||||
|
vim.opt.conceallevel = 2
|
||||||
|
vim.cmd("syntax region texMathZone start=/\\$/ skip=/\\\\\\$/ end=/\\$/ concealends contained")
|
||||||
|
vim.cmd("syntax region texMathDisplay start=/\\$\\$/ end=/\\$\\$/ concealends contained")
|
||||||
end
|
end
|
||||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
pattern = { "markdown" },
|
pattern = { "markdown" },
|
||||||
callback = function()
|
callback = function()
|
||||||
md_tex()
|
|
||||||
vim.opt_local.breakindent = true
|
vim.opt_local.breakindent = true
|
||||||
vim.opt_local.wrap = true
|
vim.opt_local.wrap = true
|
||||||
vim.opt_local.spell = true
|
vim.opt_local.spell = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue