You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies for opening up an issue for this, but I've been looking around for a while and tried various things in the docs/mentioned in issues here, but couldn't seem to be able to find a solution to this. (I don't really understand vimscript either, so also apologies if I'm missing an obvious solution here.)
I have a custom command \mathnote{...} (lifted from TeX StackExchange, which is basically a \marginnote{...} command, but works inside math environments like align) which I want to be treated like \text{...}, so it syntactically looks proper and, most importantly, doesn't cause my auto-expanding snippets to trigger while typing text.
My current workaround is pretty crude: I've basically just modified the core.vim file to recognize 'mathnote':
" Text Inside Math regionsforl:re_cmdin [
\ 'text%(normal|rm|up|tt|sf|sc)?',
\ 'intertext',
\ '[mf]box',
\ 'mathnote',
\]execute'syntax match texMathCmdText'\ '"\v\\' . l:re_cmd . '>"'\ 'contained skipwhite nextgroup=texMathTextArg'endforcallvimtex#syntax#core#new_arg('texMathTextArg')
This, of course, doesn't really work well when you need to update VimTex.
I suspect there is a way to do this via the vimrc or some sort of custom tex.vim file that I can place in my dotfiles? (Or at least something better than hacking the plugin files)
The text was updated successfully, but these errors were encountered:
Description
Apologies for opening up an issue for this, but I've been looking around for a while and tried various things in the docs/mentioned in issues here, but couldn't seem to be able to find a solution to this. (I don't really understand vimscript either, so also apologies if I'm missing an obvious solution here.)
I have a custom command
\mathnote{...}
(lifted from TeX StackExchange, which is basically a\marginnote{...}
command, but works inside math environments likealign
) which I want to be treated like\text{...}
, so it syntactically looks proper and, most importantly, doesn't cause my auto-expanding snippets to trigger while typing text.My current workaround is pretty crude: I've basically just modified the
core.vim
file to recognize 'mathnote':This, of course, doesn't really work well when you need to update VimTex.
I suspect there is a way to do this via the
vimrc
or some sort of customtex.vim
file that I can place in my dotfiles? (Or at least something better than hacking the plugin files)The text was updated successfully, but these errors were encountered: