sponsor Vim development Vim logo Vim Book Ad

basic Tip #705: Make html auto-readable in vim

 tip karma   Rating -7/12, Viewed by 607 

created:   April 21, 2004 16:01      complexity:   basic
author:   http://www.cs.albany.edu/~mosh - Mohsin      as of Vim:   6.0

Make html readable in gvim:

function! Mosh_html2text()
    :silent! %s/&lt;/</g
    :silent! %s/&gt;/>/g
    :silent! %s/&amp;/&/g
    :silent! %s/&quot;/"/g
    :silent! %s/&nbsp;/ /g
    :silent! %s/&ntilde;/\~/g
    :silent! %s/<P>//g
    :silent! %s/<BR>/ /g
    :silent! %s/</\?[BI]>/ /g
    :set readonly
endfun
:autocmd BufRead *.htm* :call Mosh_html2text()

" -- Mohsin Ahmed, http://www.cs.albany.edu/~mosh      ;

 rate this tip  Life Changing Helpful Unfulfilling 

<<Make html auto-readable in vim | Make html auto-readable in vim >>

Additional Notes

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to vim@vim.org after searching the archive. Help Bram help Uganda.
Sponsored by Web Concept Group Inc. SourceForge Logo