" via: http://vim.wikia.com/wiki/HTML_entities function HtmlEscape() silent s/&/\&/eg silent s/\</eg silent s/>/\>/eg endfunction function HtmlUnEscape() silent s/<//eg silent s/&/\&/eg endfunction map :call HtmlEscape() map :call HtmlUnEscape()