diff options
| author | Nik Clayton <nik@FreeBSD.org> | 1999-11-15 19:41:09 +0000 |
|---|---|---|
| committer | Nik Clayton <nik@FreeBSD.org> | 1999-11-15 19:41:09 +0000 |
| commit | 2ee8a10ad291c348034ff719bfe02a58507603c2 (patch) | |
| tree | 1b9062cdb3bd53516ed3c055dd105dcbcbeb0c6c /share | |
| parent | f92d0dc4467359801a95412ad9cd6c27b9cc3009 (diff) | |
Sample .vimrc and associated files for editing FDP documentation, and
maintaining structure, and so on.
Submitted by: Robert Brive <brive@freebsd-fr.org
Notes
svn path=/head/; revision=6069
Diffstat (limited to 'share')
| -rw-r--r-- | share/examples/vim/accents-sgml.vim | 19 | ||||
| -rwxr-xr-x | share/examples/vim/accents2sgml.pl | 72 | ||||
| -rw-r--r-- | share/examples/vim/edit-sgml.vim | 11 | ||||
| -rw-r--r-- | share/examples/vim/gvimrc-sample | 38 | ||||
| -rwxr-xr-x | share/examples/vim/sgml2accents.pl | 72 |
5 files changed, 212 insertions, 0 deletions
diff --git a/share/examples/vim/accents-sgml.vim b/share/examples/vim/accents-sgml.vim new file mode 100644 index 0000000000..546a98f6c4 --- /dev/null +++ b/share/examples/vim/accents-sgml.vim @@ -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 diff --git a/share/examples/vim/accents2sgml.pl b/share/examples/vim/accents2sgml.pl new file mode 100755 index 0000000000..0dd2c6eb41 --- /dev/null +++ b/share/examples/vim/accents2sgml.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl +# $FreeBSD$ +# Transform Iso-8859-1 accents in SGML notation +while (<>) { +s/�/À/g; +s/�/Á/g; +s/�/Â/g; +s/�/Ã/g; +s/�/Ä/g; +s/�/Å/g; +s/�/Å/g; +s/�/Æ/g; +s/�/Ç/g; +s/�/È'/g; +s/�/É/g; +s/�/Ê/g; +s/�/Ë/g; +s/�/Ì/g; +s/�/Í/g; +s/�/Î/g; +s/�/Ï/g; +s/�/Ð/g; +s/�/Ñ/g; +s/�/Ò/g; +s/�/Ó/g; +s/�/Ô/g; +s/�/Õ/g; +s/�/Ö/g; +s/�/×/g; +s/�/Ø/g; +s/�/Ù/g; +s/�/Ú/g; +s/�/Û/g; +s/�/Ü/g; +s/�/Ý/g; +s/�/Þ/g; +s/�/ß/g; +s/�/à/g; +s/�/á/g; +s/�/â/g; +s/�/ã/g; +s/�/ä/g; +s/�/å/g; +s/�/å/g; +s/�/æ/g; +s/�/ç/g; +s/�/è/g; +s/�/é/g; +s/�/ê/g; +s/�/ë/g; +s/�/ì/g; +s/�/í/g; +s/�/î/g; +s/�/ï/g; +s/�/ð/g; +s/�/ñ/g; +s/�/ò/g; +s/�/ó/g; +s/�/ô/g; +s/�/õ/g; +s/�/ö/g; +s/�/÷/g; +s/�/ø/g; +s/�/ù/g; +s/�/ú/g; +s/�/û/g; +s/�/ü/g; +s/�/ý/g; +s/�/þ/g; +s/�/ÿ/g; +print; +} diff --git a/share/examples/vim/edit-sgml.vim b/share/examples/vim/edit-sgml.vim new file mode 100644 index 0000000000..703ab82a9e --- /dev/null +++ b/share/examples/vim/edit-sgml.vim @@ -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 diff --git a/share/examples/vim/gvimrc-sample b/share/examples/vim/gvimrc-sample new file mode 100644 index 0000000000..d929d9dbb2 --- /dev/null +++ b/share/examples/vim/gvimrc-sample @@ -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 diff --git a/share/examples/vim/sgml2accents.pl b/share/examples/vim/sgml2accents.pl new file mode 100755 index 0000000000..d08d5209c9 --- /dev/null +++ b/share/examples/vim/sgml2accents.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl +# $FreeBSD$ +# Transform SGML notation in Iso-8859-1 accents +while (<>) { +s/À/�/g; +s/Á/�/g; +s/Â/�/g; +s/Ã/�/g; +s/Ä/�/g; +s/Å/�/g; +s/Å/�/g; +s/Æ/�/g; +s/Ç/�/g; +s/È'/�/g; +s/É/�/g; +s/Ê/�/g; +s/Ë/�/g; +s/Ì/�/g; +s/Í/�/g; +s/Î/�/g; +s/Ï/�/g; +s/Ð/�/g; +s/Ñ/�/g; +s/Ò/�/g; +s/Ó/�/g; +s/Ô/�/g; +s/Õ/�/g; +s/Ö/�/g; +s/×/�/g; +s/Ø/�/g; +s/Ù/�/g; +s/Ú/�/g; +s/Û/�/g; +s/Ü/�/g; +s/Ý/�/g; +s/Þ/�/g; +s/ß/�/g; +s/à/�/g; +s/á/�/g; +s/â/�/g; +s/ã/�/g; +s/ä/�/g; +s/å/�/g; +s/å/�/g; +s/æ/�/g; +s/ç/�/g; +s/è/�/g; +s/é/�/g; +s/ê/�/g; +s/ë/�/g; +s/ì/�/g; +s/í/�/g; +s/î/�/g; +s/ï/�/g; +s/ð/�/g; +s/ñ/�/g; +s/ò/�/g; +s/ó/�/g; +s/ô/�/g; +s/õ/�/g; +s/ö/�/g; +s/÷/�/g; +s/ø/�/g; +s/ù/�/g; +s/ú/�/g; +s/û/�/g; +s/ü/�/g; +s/ý/�/g; +s/þ/�/g; +s/ÿ/�/g; +print; +} |
