OK, this is not behavior I was expecting. Sometimes I'll post code in places where I don't have code or ecode tags, so I need to manually encode the '&', '<' and '>' symbols. That gets very annoying, particularly since I often find myself encoding the ampersand last, screwing up the other encodings and having to redo it. I figured that a simple vim mapping would do this:
,e :%s/&/\&/g | %s/>/\>/g |%s/</\</g<cr>
However, that fails because as soon as I source my
,e :exe '%s/&/\&/g | %s/>/\>/g |%s/</\</g'<cr>
That does the same thing. What gives? Am I going to have to write a function for this?