Auto commit: 2024-11-08 02:55:02
This commit is contained in:
parent
e0f48024b9
commit
4754af3d64
3 changed files with 8 additions and 22 deletions
|
@ -1,38 +1,23 @@
|
||||||
-- Autocmds are automatically loaded on the VeryLazy event
|
-- Autocmds are automatically loaded on the VeryLazy event
|
||||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||||
-- Add any additional autocmds here
|
-- Add any additional autocmds here
|
||||||
-- vim.cmd("let &t_ut=''")
|
|
||||||
vim.opt_local.breakindent = true
|
vim.opt_local.breakindent = true
|
||||||
vim.opt_local.wrap = true
|
vim.opt_local.wrap = true
|
||||||
local md_tex = function()
|
|
||||||
-- vim.cmd("syn region markdownMathInline matchgroup=texMathZone start=/$/ end=/$/ contains=@texMath")
|
|
||||||
-- vim.cmd("syn match markdownMathInline '$[^$].{-}$' contains=@texMath")
|
|
||||||
-- vim.cmd("syn region markdownMathBlock matchgroup=texMathZone start=/$$/ end=/$$/ contains=@texMath")
|
|
||||||
-- 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
|
-- This autocommand fixes syntax highlighting for inline math in markdown files
|
||||||
vim.cmd("syntax region texMathZone start=/\\$/ end=/\\$/ contained contains=@tex")
|
-- Together with vimtex, it will apply very sexy good stuff here!
|
||||||
|
|
||||||
-- 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
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "markdown",
|
pattern = "markdown",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
syn region math start=/\$\$/ end=/\$\$/ contains=@tex=tex
|
syn region mathBlock start=/\$\$/ end=/\$\$/ contains=@tex
|
||||||
" inline math
|
" inline math
|
||||||
syn match math '\$[^$].\{-}\$' contains=@tex
|
syn match mathInline '\$[^$].\{-}\$' contains=@tex
|
||||||
" syn include @tex syntax/tex.vim
|
" syn include @tex syntax/tex.vim
|
||||||
" actually highlight the region we defined as "math"
|
" actually highlight the region we defined as "math"
|
||||||
hi link math Statement
|
syn include @tex syntax/tex.vim
|
||||||
|
hi def link mathBlock Statement
|
||||||
|
hi def link mathInline Statement
|
||||||
]])
|
]])
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -58,3 +58,4 @@ NetworkX
|
||||||
ie
|
ie
|
||||||
unicode
|
unicode
|
||||||
ints
|
ints
|
||||||
|
oplus
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue