Jump to content

Nvim Regex by @Rongzhou

From Wikibase
Tag: Reverted
Tag: Manual revert
Line 16: Line 16:


<syntaxhighlight lang="text" copy>
<syntaxhighlight lang="text" copy>
:%s/\v\((.{-})\)|\\\[(\_.{-})\\\]/\=submatch(1) != '' ? '$'.submatch(1).'$' : '$$'.submatch(2).'$$'/g
:%s/\(\\(\(.\{-}\)\\)\)\|\(\\\[\(\_.\{-}\)\\\]\)/\=submatch(1) != '' ? '$'.submatch(2).'$' : '$$'.submatch(4).'$$'/g
</syntaxhighlight>
</syntaxhighlight>



Revision as of 14:30, 29 September 2026

Markdown /md

Text <> list

:%s#^#- #
:%s#^- ##

Katex

\[ \( <> $$ $ separator change:

:%s/\(\\(\(.\{-}\)\\)\)\|\(\\\[\(\_.\{-}\)\\\]\)/\=submatch(1) != '' ? '$'.submatch(2).'$' : '$$'.submatch(4).'$$'/g
:%s/\$\$\(\_.\{-}\)\$\$\|\$\(.\{-}\)\$/\=submatch(0) =~ '^\$\$' ? '\['.submatch(1).'\]' : '\('.submatch(2).'\)'/g