doc/share/examples/vim/accents-sgml.vim
Nik Clayton 2ee8a10ad2 Sample .vimrc and associated files for editing FDP documentation, and
maintaining structure, and so on.

Submitted by:   Robert Brive <brive@freebsd-fr.org
1999-11-15 19:41:09 +00:00

19 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 â|map! ^e ê|map! ^i î|map! ^o ô|map! ^u û
" 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