User:Memming/vimcmds

From Scholarpedia

This page is not peer reviewed. Contributors to this page are not anonymous.

Hopefully this page will evolve and automate stuff.

  • Convert [something] to (something): %s/\(\[\)\@<!\[\(\_[^\[]\{-}\)\]/(\2)/gc
  • 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/<math>\s*\\epsilon\s*<\/math>/ε/gc
    • %s/<math>\s*\\Omega\s*<\/math>/Ω/gc
    • %s/<math>\s*\(\w*\)^{\?\(\w\)}\?\s*<\/math>/\1<sup>\2<\/sup>/gc
    • %s/<math>\s*\(\w*\)\s*<\/math>/ ''\1''/gc
  • remove old boldmath commands
    • %s/\\mbox{\\boldmath\$\(.\{-\}\)\$}/\\mathbf{\1}/gc
    • %s/{\\boldmath\$\(.\{-\}\)\$}/\$\\mathbf{\1}\$/gc
  • Standard manipulations
    • %s/\\begin{equation}/:<math>/g
    • %s/\\end{equation}/<\/math>/g
    • %s/\\section{\(.*\)\}/== \1 ==/
    • %s/\\\[/:<math>/g
    • %s/\\\]/<\/math>/g
    • %s/{\\em \(.\{-\}\)}/'''\1'''/g</math>
For authors