Useful regexes ============== ### Vim: convert lcc to lcu (repeat as many times as necessary) 1. Convert someThingElse2( to some_thing_else2( but avoid things that start with upper case Use: :g!/^class/[cmd] + s/\([^.]\)\(\u\)\(\(_\=\l\+\)\+\d\?\)(/\1_\L\2\e\3(/gc So full expression is: :g!/^class/s/\(\u\)\(\(_\=\l\+\)\+\)(/_\L\1\e\2(/g Convert self.demandFunction to self.demand_function s/self\.\(\(\l\|_\)\+\)\(\u\)/self.\1_\L\3/gc ### Converting okftext stuff post convert to markdown: Convert $$ ... $$ to $$ \[ ... \] $$ %s/^\s*\$\$\(.*\)\$\$\s*/$$ \\[ \1 \\] $$/gc Remove <

stuff %s/^>

\s*\n//gc Lemmas and Proofs: %s/\\textbf{Lemma \(\d\):} /\\begin{lemma}^M\\label{lemma-\1}^M/gc %s/\n\\textbf{Proof:} \(.*\)/\\end{lemma}^M\\begin{proof}^M\1^M\\end{proof}/gc %s/]*>/(pp. \1) /gc ## Bibtex/Biblio stuff ### Zotero name_blah_date to name_ea_data 'a,'bs/_\w\w\w\+_\(\d\d\d\d\)/_ea_\1/gc ### Convert urls 'a,'bs/url \?=/url-src=/gc ### Redo titles %s/title \== \={\([^{][^}]*\)}/title={{\1}}/gc ## Convert markdown to plain text Convert [...](...) to ... (...) 'a,$s:\[\([^]]*\)\](:\1 (:gc ## Convert from twill to paste.fixture %s/TestControllerTwill/TestController2/gc %s/web.go(\(.*\))/res = self.app.get(\1)/gc %s/web.submit()/fv.submit()/gc %s/web.show()/str(res)/gc %s/web.fv(fn, \(.*\),\(.*\))/fv[\1] = \2/gc %s/web.find(\(.*\))/assert \1 in res/gc %s/web.follow(\(.*\))/res = res.click(\1)/gc