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>

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

--ZPt4rx8FFjLCG7dd
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

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>

--ZPt4rx8FFjLCG7dd
Content-Type: application/x-perl
Content-Disposition: attachment; filename="accents2sgml.pl"
Content-Transfer-Encoding: quoted-printable

#!/usr/bin/perl=0Awhile (<>) {=0As/=C0/&Agrave;/g;=0As/=C1/&Aacute;/g;=0As/=
=C2/&Acirc;/g;=0As/=C3/&Atilde;/g;=0As/=C4/&Auml;/g;=0As/=C5/&Aring;/g;=0As=
/=C5/&Aring;/g;=0As/=C6/&AElig;/g;=0As/=C7/&Ccedil;/g;=0As/=C8/&Egrave'/g;=
=0As/=C9/&Eacute;/g;=0As/=CA/&Ecirc;/g;=0As/=CB/&Euml;/g;=0As/=CC/&Igrave;/=
g;=0As/=CD/&Iacute;/g;=0As/=CE/&Icirc;/g;=0As/=CF/&Iuml;/g;=0As/=D0/&ETH;/g=
;=0As/=D1/&Ntilde;/g;=0As/=D2/&Ograve;/g;=0As/=D3/&Oacute;/g;=0As/=D4/&Ocir=
c;/g;=0As/=D5/&Otilde;/g;=0As/=D6/&Ouml;/g;=0As/=D7/&times;/g;=0As/=D8/&Osl=
ash;/g;=0As/=D9/&Ugrave;/g;=0As/=DA/&Uacute;/g;=0As/=DB/&Ucirc;/g;=0As/=DC/=
&Uuml;/g;=0As/=DD/&Yacute;/g;=0As/=DE/&THORN;/g;=0As/=DF/&szlig;/g;=0As/=E0=
/&agrave;/g;=0As/=E1/&aacute;/g;=0As/=E2/&acirc;/g;=0As/=E3/&atilde;/g;=0As=
/=E4/&auml;/g;=0As/=E5/&aring;/g;=0As/=E5/&aring;/g;=0As/=E6/&aelig;/g;=0As=
/=E7/&ccedil;/g;=0As/=E8/&egrave;/g;=0As/=E9/&eacute;/g;=0As/=EA/&ecirc;/g;=
=0As/=EB/&euml;/g;=0As/=EC/&igrave;/g;=0As/=ED/&iacute;/g;=0As/=EE/&icirc;/=
g;=0As/=EF/&iuml;/g;=0As/=F0/&eth;/g;=0As/=F1/&ntilde;/g;=0As/=F2/&ograve;/=
g;=0As/=F3/&oacute;/g;=0As/=F4/&ocirc;/g;=0As/=F5/&otilde;/g;=0As/=F6/&ouml=
;/g;=0As/=F7/&divide;/g;=0As/=F8/&oslash;/g;=0As/=F9/&ugrave;/g;=0As/=FA/&u=
acute;/g;=0As/=FB/&ucirc;/g;=0As/=FC/&uuml;/g;=0As/=FD/&yacute;/g;=0As/=FE/=
&thorn;/g;=0As/=FF/&yuml;/g;=0Aprint;=0A}=0A
--ZPt4rx8FFjLCG7dd
Content-Type: application/x-perl
Content-Disposition: attachment; filename="sgml2accents.pl"
Content-Transfer-Encoding: quoted-printable

#!/usr/bin/perl=0Awhile (<>) {=0As/&Agrave;/=C0/g;=0As/&Aacute;/=C1/g;=0As/=
&Acirc;/=C2/g;=0As/&Atilde;/=C3/g;=0As/&Auml;/=C4/g;=0As/&Aring;/=C5/g;=0As=
/&Aring;/=C5/g;=0As/&AElig;/=C6/g;=0As/&Ccedil;/=C7/g;=0As/&Egrave'/=C8/g;=
=0As/&Eacute;/=C9/g;=0As/&Ecirc;/=CA/g;=0As/&Euml;/=CB/g;=0As/&Igrave;/=CC/=
g;=0As/&Iacute;/=CD/g;=0As/&Icirc;/=CE/g;=0As/&Iuml;/=CF/g;=0As/&ETH;/=D0/g=
;=0As/&Ntilde;/=D1/g;=0As/&Ograve;/=D2/g;=0As/&Oacute;/=D3/g;=0As/&Ocirc;/=
=D4/g;=0As/&Otilde;/=D5/g;=0As/&Ouml;/=D6/g;=0As/&times;/=D7/g;=0As/&Oslash=
;/=D8/g;=0As/&Ugrave;/=D9/g;=0As/&Uacute;/=DA/g;=0As/&Ucirc;/=DB/g;=0As/&Uu=
ml;/=DC/g;=0As/&Yacute;/=DD/g;=0As/&THORN;/=DE/g;=0As/&szlig;/=DF/g;=0As/&a=
grave;/=E0/g;=0As/&aacute;/=E1/g;=0As/&acirc;/=E2/g;=0As/&atilde;/=E3/g;=0A=
s/&auml;/=E4/g;=0As/&aring;/=E5/g;=0As/&aring;/=E5/g;=0As/&aelig;/=E6/g;=0A=
s/&ccedil;/=E7/g;=0As/&egrave;/=E8/g;=0As/&eacute;/=E9/g;=0As/&ecirc;/=EA/g=
;=0As/&euml;/=EB/g;=0As/&igrave;/=EC/g;=0As/&iacute;/=ED/g;=0As/&icirc;/=EE=
/g;=0As/&iuml;/=EF/g;=0As/&eth;/=F0/g;=0As/&ntilde;/=F1/g;=0As/&ograve;/=F2=
/g;=0As/&oacute;/=F3/g;=0As/&ocirc;/=F4/g;=0As/&otilde;/=F5/g;=0As/&ouml;/=
=F6/g;=0As/&divide;/=F7/g;=0As/&oslash;/=F8/g;=0As/&ugrave;/=F9/g;=0As/&uac=
ute;/=FA/g;=0As/&ucirc;/=FB/g;=0As/&uuml;/=FC/g;=0As/&yacute;/=FD/g;=0As/&t=
horn;/=FE/g;=0As/&yuml;/=FF/g;=0Aprint;=0A}=0A
--ZPt4rx8FFjLCG7dd--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




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