Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Oct 1999 23:57:44 +0200
From:      Robert Brive <brive@freebsd-fr.org>
To:        Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
Cc:        freebsd-doc@freebsd.org
Subject:   Re: For the vim users here
Message-ID:  <19991028235743.B469@ppp1-cergy.isdnet.net>
In-Reply-To: <19991026061250.C24278@daemon.ninth-circle.org>; from Jeroen Ruigrok/Asmodai on Tue, Oct 26, 1999 at 06:12:50AM %2B0200
References:  <19991024203326.D17828@daemon.ninth-circle.org> <19991025082320.H2102@kilt.nothing-going-on.org> <19991026061250.C24278@daemon.ninth-circle.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Tue, Oct 26, 1999 at 06:12:50AM +0200, Jeroen Ruigrok/Asmodai wrote:
> -On [19991026 00:00], Nik Clayton (nik@freebsd.org) wrote:
> 
> [snip vim sgml edit commands]
> 
> >Stuff like this should probably be added to 
> >
> >  (a) the Primer
> >
> >  (b) doc/share/examples/vim, or a similar directory.
> 
> Feel free to use it in there.  Might help jumpstart new -doc people whom
> for likewise reasons as me refuse to run emacs. 
> 
> -- 
> Jeroen Ruigrok van der Werven/Asmodai                  asmodai(at)wxs.nl

For people working with iso-8859-1 accents, who want to work with their
native representation (âà...) but stay with files in the SGML form
(&acirc;&agrave;...), I suggest the following commands:

  " accents in SGML
  if !exists("autocommands_accents_sgml")
    let autocommands_accents_sgml = 1
    " on reads, have a native representation
    autocmd BufReadPost,FileReadPost *.sgml,*.ent,*.html '[,']!$HOME/.vim/sgml2accents.pl
    autocmd BufReadPost,FileReadPost *.sgml,*.ent,*.html syn match sgmlSpecial "&[^;]*;"
    autocmd BufReadPost,FileReadPost *.sgml,*.ent,*.html set sts=2
    "set ai sts=2 ts=8 sw=2 tw=70 (nbm@mithrandr.moria.org?)
    " to correct some accents (on my french keyboard)
    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

It seems that your lines corresponds roughly to the line in comments 
("set ai sts=2 ts=8 sw=2 tw=70).

	Any comments?
-- 

	Robert Brive  <brive@mail.dotcom.fr>
		      <brive@freebsd-fr.org>

[-- Attachment #2 --]
#!/usr/bin/perl
while (<>) {
s/À/&Agrave;/g;
s/Á/&Aacute;/g;
s/Â/&Acirc;/g;
s/Ã/&Atilde;/g;
s/Ä/&Auml;/g;
s/Å/&Aring;/g;
s/Å/&Aring;/g;
s/Æ/&AElig;/g;
s/Ç/&Ccedil;/g;
s/È/&Egrave'/g;
s/É/&Eacute;/g;
s/Ê/&Ecirc;/g;
s/Ë/&Euml;/g;
s/Ì/&Igrave;/g;
s/Í/&Iacute;/g;
s/Î/&Icirc;/g;
s/Ï/&Iuml;/g;
s/Ð/&ETH;/g;
s/Ñ/&Ntilde;/g;
s/Ò/&Ograve;/g;
s/Ó/&Oacute;/g;
s/Ô/&Ocirc;/g;
s/Õ/&Otilde;/g;
s/Ö/&Ouml;/g;
s/×/&times;/g;
s/Ø/&Oslash;/g;
s/Ù/&Ugrave;/g;
s/Ú/&Uacute;/g;
s/Û/&Ucirc;/g;
s/Ü/&Uuml;/g;
s/Ý/&Yacute;/g;
s/Þ/&THORN;/g;
s/ß/&szlig;/g;
s/à/&agrave;/g;
s/á/&aacute;/g;
s/â/&acirc;/g;
s/ã/&atilde;/g;
s/ä/&auml;/g;
s/å/&aring;/g;
s/å/&aring;/g;
s/æ/&aelig;/g;
s/ç/&ccedil;/g;
s/è/&egrave;/g;
s/é/&eacute;/g;
s/ê/&ecirc;/g;
s/ë/&euml;/g;
s/ì/&igrave;/g;
s/í/&iacute;/g;
s/î/&icirc;/g;
s/ï/&iuml;/g;
s/ð/&eth;/g;
s/ñ/&ntilde;/g;
s/ò/&ograve;/g;
s/ó/&oacute;/g;
s/ô/&ocirc;/g;
s/õ/&otilde;/g;
s/ö/&ouml;/g;
s/÷/&divide;/g;
s/ø/&oslash;/g;
s/ù/&ugrave;/g;
s/ú/&uacute;/g;
s/û/&ucirc;/g;
s/ü/&uuml;/g;
s/ý/&yacute;/g;
s/þ/&thorn;/g;
s/ÿ/&yuml;/g;
print;
}

[-- Attachment #3 --]
#!/usr/bin/perl
while (<>) {
s/&Agrave;/À/g;
s/&Aacute;/Á/g;
s/&Acirc;/Â/g;
s/&Atilde;/Ã/g;
s/&Auml;/Ä/g;
s/&Aring;/Å/g;
s/&Aring;/Å/g;
s/&AElig;/Æ/g;
s/&Ccedil;/Ç/g;
s/&Egrave'/È/g;
s/&Eacute;/É/g;
s/&Ecirc;/Ê/g;
s/&Euml;/Ë/g;
s/&Igrave;/Ì/g;
s/&Iacute;/Í/g;
s/&Icirc;/Î/g;
s/&Iuml;/Ï/g;
s/&ETH;/Ð/g;
s/&Ntilde;/Ñ/g;
s/&Ograve;/Ò/g;
s/&Oacute;/Ó/g;
s/&Ocirc;/Ô/g;
s/&Otilde;/Õ/g;
s/&Ouml;/Ö/g;
s/&times;/×/g;
s/&Oslash;/Ø/g;
s/&Ugrave;/Ù/g;
s/&Uacute;/Ú/g;
s/&Ucirc;/Û/g;
s/&Uuml;/Ü/g;
s/&Yacute;/Ý/g;
s/&THORN;/Þ/g;
s/&szlig;/ß/g;
s/&agrave;/à/g;
s/&aacute;/á/g;
s/&acirc;/â/g;
s/&atilde;/ã/g;
s/&auml;/ä/g;
s/&aring;/å/g;
s/&aring;/å/g;
s/&aelig;/æ/g;
s/&ccedil;/ç/g;
s/&egrave;/è/g;
s/&eacute;/é/g;
s/&ecirc;/ê/g;
s/&euml;/ë/g;
s/&igrave;/ì/g;
s/&iacute;/í/g;
s/&icirc;/î/g;
s/&iuml;/ï/g;
s/&eth;/ð/g;
s/&ntilde;/ñ/g;
s/&ograve;/ò/g;
s/&oacute;/ó/g;
s/&ocirc;/ô/g;
s/&otilde;/õ/g;
s/&ouml;/ö/g;
s/&divide;/÷/g;
s/&oslash;/ø/g;
s/&ugrave;/ù/g;
s/&uacute;/ú/g;
s/&ucirc;/û/g;
s/&uuml;/ü/g;
s/&yacute;/ý/g;
s/&thorn;/þ/g;
s/&yuml;/ÿ/g;
print;
}
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991028235743.B469>