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:
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
share/examples/vim
19
share/examples/vim/accents-sgml.vim
Normal file
19
share/examples/vim/accents-sgml.vim
Normal 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
|
72
share/examples/vim/accents2sgml.pl
Executable file
72
share/examples/vim/accents2sgml.pl
Executable file
|
@ -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;
|
||||
}
|
11
share/examples/vim/edit-sgml.vim
Normal file
11
share/examples/vim/edit-sgml.vim
Normal 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
|
38
share/examples/vim/gvimrc-sample
Normal file
38
share/examples/vim/gvimrc-sample
Normal 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
|
72
share/examples/vim/sgml2accents.pl
Executable file
72
share/examples/vim/sgml2accents.pl
Executable file
|
@ -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;
|
||||
}
|
Loading…
Reference in a new issue