Sample .vimrc and associated files for editing FDP documentation, and

maintaining structure, and so on.

Submitted by:   Robert Brive <brive@freebsd-fr.org
This commit is contained in:
Nik Clayton 1999-11-15 19:41:09 +00:00
parent f92d0dc446
commit 2ee8a10ad2
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=6069
5 changed files with 212 additions and 0 deletions

View file

@ -0,0 +1,19 @@
" 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

View file

@ -0,0 +1,72 @@
#!/usr/bin/perl
# $FreeBSD$
# Transform Iso-8859-1 accents in SGML notation
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;
}

View file

@ -0,0 +1,11 @@
" formatting SGML documents
" $FreeBSD$
if !exists("format_fdp_sgml")
let format_fdp_sgml = 1
" correction for highlighting special characters
autocmd BufNewFile,BufRead *.sgml,*.ent,*.html syn match sgmlSpecial "&[^;]*;"
" formatting FreeBSD SGML/Docbook
autocmd BufNewFile,BufRead *.sgml,*.ent set autoindent formatoptions=tcq2l textwidth=70 shiftwidth=2 softtabstop=2 tabstop=8
endif

View file

@ -0,0 +1,38 @@
" $FreeBSD$
" An example for a gvimrc file.
" The commands in this are executed when the GUI is started.
" (based on the work done by Bram Moolenaar <Bram@vim.org>)
"
" To use it, copy it to
" for Unix and OS/2: ~/.gvimrc
" for Amiga: s:.gvimrc
" for MS-DOS and Win32: $VIM\_gvimrc
"
" And copy the other files to your $HOME/.vim directory
" Make command line two lines high
set ch=2
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" Only do this for Vim version 5.0 and later.
if version >= 500
" Switch on syntax highlighting.
syntax on
" Switch on search pattern highlighting.
set hlsearch
" Hide the mouse pointer while typing
set mousehide
" Edit FreeBSD DocBook files
source $HOME/.vim/edit-sgml.vim
" Iso-8859-1 accents in SGML
source $HOME/.vim/accents-sgml.vim
endif

View file

@ -0,0 +1,72 @@
#!/usr/bin/perl
# $FreeBSD$
# Transform SGML notation in Iso-8859-1 accents
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;
}