Thursday, January 20, 2011

Replacing Vim Special Characters

I wrote my first LaTeX macro today which makes some things much easier and prettier. As I was cleaning up my files I needed to substitue a string with the command \spath{}. Well vim did not put the "\" since its an special charater for the substitue function.
Five minutes of searching and I learned that to escape these special chars use the \\. So typing

%s#original-string#\\\spath{}#g

Made the change. Thank you internet machine!

No comments: