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
For authors