Added html escaping script using C-h
This commit is contained in:
15
vim/plugin/htmlescape.vim
Normal file
15
vim/plugin/htmlescape.vim
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
" 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
|
||||||
|
silent s/&/\&/eg
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
map <silent> <c-h> :call HtmlEscape()<CR>
|
||||||
|
map <silent> <c-u> :call HtmlUnEscape()<CR>
|
||||||
Reference in New Issue
Block a user