User:Il Park/vimcmds
From Scholarpedia
< User:Il Park(Redirected from User:Memming/vimcmds)
Hopefully this page will evolve and automate stuff.
- Convert $blah$ to
: %s/\$\([^$]\{-}\)\$/
- Convert [something] to (something):
%s/\(\[\)\@
- Search stuff containing numbers in parenthesis:
/(\(\_[^)]\{-}\d\+[^)]\{-}\))/
- Insert * on every non-empty line:
s/^\(\a\)/\* \1/
- Do not do the following removal of LaTeX math:
-
%s/ -
%s/ -
%s/ -
%s/
-
- remove old boldmath commands
-
%s/\\mbox{\\boldmath\$\(.\{-\}\)\$}/\\mathbf{\1}/gc -
%s/{\\boldmath\$\(.\{-\}\)\$}/\$\\mathbf{\1}\$/gc
-
- Standard manipulations
-
%s/\\begin{equation}/: -
%s/\\end{equation}/<\/math>/g -
%s/\\section{\(.*\)\}/== \1 ==/ -
%s/\\\[/: -
%s/\\\]/<\/math>/g -
%s/{\\em \(.\{-\}\)}/'''\1'''/g
-
- The surround.vim helps a lot. Use
S command to surround the selected text.