User:Il Park/vimcmds

From Scholarpedia
Jump to: navigation, search

Hopefully this page will evolve and automate stuff.

  • Convert $blah$ to blah: %s/\$\([^$]\{-}\)\$/\1<\/math>/g
  • 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*\\epsilon\s*<\/math>/ε/gc
    • %s/\s*\\Omega\s*<\/math>/Ω/gc
    • %s/\s*\(\w*\)^{\?\(\w\)}\?\s*<\/math>/\1\2<\/sup>/gc
    • %s/\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}/:/g
    • %s/\\end{equation}/<\/math>/g
    • %s/\\section{\(.*\)\}/== \1 ==/
    • %s/\\\[/:/g
    • %s/\\\]/<\/math>/g
    • %s/{\\em \(.\{-\}\)}/'''\1'''/g
  • The surround.vim helps a lot. Use S command to surround the selected text.
Personal tools
Namespaces
Variants
Actions
Navigation
Focal areas
Activity
Toolbox