20 lines
632 B
VimL
20 lines
632 B
VimL
|
" accents in SGML
|
|||
|
" $FreeBSD$
|
|||
|
|
|||
|
" don't do it twice
|
|||
|
if !exists("autocommands_accents_sgml")
|
|||
|
let autocommands_accents_sgml = 1
|
|||
|
|
|||
|
" on reads, have a native (iso-8859-1) representation
|
|||
|
autocmd BufReadPost,FileReadPost *.sgml,*.ent,*.html '[,']!$HOME/.vim/sgml2accents.pl
|
|||
|
|
|||
|
" to correct some accents
|
|||
|
autocmd BufEnter * map! ^a <20>|map! ^e <20>|map! ^i <20>|map! ^o <20>|map! ^u <20>
|
|||
|
|
|||
|
" on writes, have the SGML syntax
|
|||
|
autocmd BufWritePre,FileWritePre *.sgml,*.ent,*.html '[,']!$HOME/.vim/accents2sgml.pl
|
|||
|
" then go back with native accents
|
|||
|
autocmd BufWritePost,FileWritePost *.sgml,*.ent,*.html '[,']!$HOME/.vim/sgml2accents.pl
|
|||
|
|
|||
|
endif
|