cvsdist e5ebff
set nocompatible	" Use Vim defaults (much better!)
cvsdist e5ebff
set bs=2		" allow backspacing over everything in insert mode
cvsdist e5ebff
"set ai			" always set autoindenting on
cvsdist e5ebff
"set backup		" keep a backup file
cvsdist e5ebff
set viminfo='20,\"50	" read/write a .viminfo file, don't store more
cvsdist e5ebff
			" than 50 lines of registers
cvsdist e5ebff
set history=50		" keep 50 lines of command line history
cvsdist e5ebff
set ruler		" show the cursor position all the time
cvsdist e5ebff
cvsdist e5ebff
" Only do this part when compiled with support for autocommands
cvsdist e5ebff
if has("autocmd")
cvsdist e5ebff
  " In text files, always limit the width of text to 78 characters
cvsdist e5ebff
  autocmd BufRead *.txt set tw=78
cvsdist e5ebff
  " When editing a file, always jump to the last cursor position
cvsdist e5ebff
  autocmd BufReadPost * if line("'\"") | exe "'\"" | endif
cvsdist f1dd31
endif
cvsdist f1dd31
cvsdist e5ebff
" Don't use Ex mode, use Q for formatting
cvsdist e5ebff
map Q gq
cvsdist f1dd31
cvsdist e5ebff
" Switch syntax highlighting on, when the terminal has colors
cvsdist e5ebff
" Also switch on highlighting the last used search pattern.
cvsdist e5ebff
if &t_Co > 2 || has("gui_running")
cvsdist e5ebff
  syntax on
cvsdist e5ebff
  set hlsearch
cvsdist e5ebff
endif
cvsdist e5ebff
cvsdist e5ebff
if has("autocmd")
cvsdist e5ebff
 augroup cprog
cvsdist e5ebff
  " Remove all cprog autocommands
cvsdist e5ebff
  au!
cvsdist f1dd31
cvsdist e5ebff
  " When starting to edit a file:
cvsdist e5ebff
  "   For C and C++ files set formatting of comments and set C-indenting on.
cvsdist e5ebff
  "   For other files switch it off.
cvsdist e5ebff
  "   Don't change the order, it's important that the line with * comes first.
cvsdist e5ebff
  autocmd FileType *      set formatoptions=tcql nocindent comments&
cvsdist e5ebff
  autocmd FileType c,cpp  set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
cvsdist e5ebff
 augroup END
cvsdist f1dd31
cvsdist e5ebff
 augroup gzip
cvsdist e5ebff
  " Remove all gzip autocommands
cvsdist e5ebff
  au!
cvsdist f1dd31
cvsdist e5ebff
  " Enable editing of gzipped files
cvsdist e5ebff
  "	  read:	set binary mode before reading the file
cvsdist e5ebff
  "		uncompress text in buffer after reading
cvsdist e5ebff
  "	 write:	compress file after writing
cvsdist e5ebff
  "	append:	uncompress file, append, compress file
cvsdist e5ebff
  autocmd BufReadPre,FileReadPre	*.gz set bin
cvsdist e5ebff
  autocmd BufReadPost,FileReadPost	*.gz let ch_save = &ch|set ch=2
cvsdist e5ebff
  autocmd BufReadPost,FileReadPost	*.gz '[,']!gunzip
cvsdist e5ebff
  autocmd BufReadPost,FileReadPost	*.gz set nobin
cvsdist e5ebff
  autocmd BufReadPost,FileReadPost	*.gz let &ch = ch_save|unlet ch_save
cvsdist e5ebff
  autocmd BufReadPost,FileReadPost	*.gz execute ":doautocmd BufReadPost " . expand("%:r")
cvsdist f1dd31
cvsdist e5ebff
  autocmd BufWritePost,FileWritePost	*.gz !mv <afile> <afile>:r
cvsdist e5ebff
  autocmd BufWritePost,FileWritePost	*.gz !gzip <afile>:r
cvsdist f1dd31
cvsdist e5ebff
  autocmd FileAppendPre			*.gz !gunzip <afile>
cvsdist e5ebff
  autocmd FileAppendPre			*.gz !mv <afile>:r <afile>
cvsdist e5ebff
  autocmd FileAppendPost		*.gz !mv <afile> <afile>:r
cvsdist e5ebff
  autocmd FileAppendPost		*.gz !gzip <afile>:r
cvsdist e5ebff
 augroup END
cvsdist e5ebff
endif
cvsdist e5ebff
if &term=="xterm"
cvsdist e5ebff
     set t_Co=8
cvsdist e5ebff
     set t_Sb=^[4%dm
cvsdist e5ebff
     set t_Sf=^[3%dm
cvsdist e5ebff
endif
cvsdist f1dd31
cvsdist e5ebff
" some extra commands for HTML editing
cvsdist e5ebff
nmap ,mh wbgueyei<<ESC>ea></<ESC>pa><ESC>bba
cvsdist e5ebff
nmap ,h1 _i

<ESC>A

<ESC>
cvsdist e5ebff
nmap ,h2 _i

<ESC>A

<ESC>
cvsdist e5ebff
nmap ,h3 _i

<ESC>A

<ESC>
cvsdist e5ebff
nmap ,h4 _i

<ESC>A

<ESC>
cvsdist e5ebff
nmap ,h5 _i
<ESC>A
<ESC>
cvsdist e5ebff
nmap ,h6 _i
<ESC>A
<ESC>
cvsdist e5ebff
nmap ,hb wbi<ESC>ea<ESC>bb
cvsdist e5ebff
nmap ,he wbi<ESC>ea<ESC>bb
cvsdist e5ebff
nmap ,hi wbi<ESC>ea<ESC>bb
cvsdist e5ebff
nmap ,hu wbi<u><ESC>ea<ESC>bb
cvsdist e5ebff
nmap ,hs wbi<ESC>ea<ESC>bb
cvsdist e5ebff
nmap ,ht wbi<tt><ESC>ea</tt><ESC>bb
cvsdist e5ebff
nmap ,hx wbF<df>f<df>
cvsdist f1dd31