diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index c0b2c994..2e19cd70 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -3,7 +3,14 @@ -- Add any additional autocmds here vim.opt_local.breakindent = true vim.opt_local.wrap = true - +vim.api.nvim_create_autocmd("FileType", { + pattern = "tex", + callback = function() + vim.cmd([[ + syntax match texMathSymbol "\\oplus" conceal cchar=⊕ + ]]) + end, +}) -- This autocommand fixes syntax highlighting for inline math in markdown files -- Together with vimtex, it will apply very sexy good stuff here! vim.api.nvim_create_autocmd("FileType", { @@ -18,14 +25,18 @@ vim.api.nvim_create_autocmd("FileType", { syn include @tex syntax/tex.vim hi def link mathBlock Statement hi def link mathInline Statement - let g:vimtex_syntax_custom_cmds = [ - " \ {'name': 'vct', 'mathmode': 1, 'argstyle': 'bold'}, - \ {'name': 'oplus', 'mathmode': 1, 'concealchar': 'ℝ'}, - " \ {'name': 'R', 'mathmode': 1, 'concealchar': 'ℝ'}, - " \ {'name': 'mathnote', 'mathmode': 1, 'nextgroup': 'texMathTextArg'}, - " \ {'name': 'nospell', 'argspell': 0}, - ] + " let g:vimtex_syntax_custom_cmds = [ + " \ {'name': 'vct', 'mathmode': 1, 'argstyle': 'bold'}, + " \ {'name': 'R', 'cmdre': 'R>', 'mathmode': 1, 'concealchar': 'ℝ'}, + " \ {'name': 'R', 'mathmode': 1, 'concealchar': 'ℝ'}, + " \ {'name': 'mathnote', 'mathmode': 1, 'nextgroup': 'texMathTextArg'}, + " \ {'name': 'nospell', 'argspell': 0}, + " \] ]]) + vim.g.vimtex_syntax_custom_cmds = vim.tbl_extend("force", vim.g.vimtex_syntax_custom_cmds or {}, { + -- { name = "oplus", mathmode = 1, concealchar = "⊕" }, + { name = "oplus", mathmode = 1, concealchar = "⊕" }, + }) -- vim.g.vimtex_syntax_conceal = { -- math = 1, -- oplus = "⊕",