Sunday, April 29, 2012

Wrap acronyms with \ac in Vim

:s/\(\W\)\(\u\{2,10\}\)\(\W\)/\1\\ac{\2}\3/g
:s/\(\W\)\(\u\{2,10\}\)$/\1\\ac{\2}/g
:s/^\(\u\{2,10\}\)\(\W\)/\\ac{\1}\2/g
:s/^\(\u\{2,10\}\)$/\\ac{\1}/g

No comments: