From 41cab07881ecf799a8ceb1276184869116d65b1f Mon Sep 17 00:00:00 2001 From: yan Date: Wed, 30 Nov 2011 09:34:32 -0800 Subject: [PATCH] Added html escaping script using C-h --- vim/plugin/htmlescape.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 vim/plugin/htmlescape.vim diff --git a/vim/plugin/htmlescape.vim b/vim/plugin/htmlescape.vim new file mode 100644 index 00000000..fa4bc748 --- /dev/null +++ b/vim/plugin/htmlescape.vim @@ -0,0 +1,15 @@ +" via: http://vim.wikia.com/wiki/HTML_entities +function HtmlEscape() + silent s/&/\&/eg + silent s//\>/eg +endfunction + +function HtmlUnEscape() + silent s/<//eg + silent s/&/\&/eg +endfunction + +map :call HtmlEscape() +map :call HtmlUnEscape()