" vim:set ts=4 sw=4:
" David Edwards' personal Vim settings file
"
" To use it, copy it to a place specified by ":version" in vi
"
" Last Modified: Mon Oct 27 22:36:56 1997

" Use special Vim features
set nocompatible

" Ignore pattern match case only if string is all upper case
set ignorecase
set smartcase

" allow backspacing over everything in insert mode
set bs=2

" always set autoindenting on
set ai

" read/write a .viminfo file, don't store more than 50 lines of registers
set viminfo='20,\"50

" always display a status line at the bottom of window
" Set to 2 for bar across bottom (was 1)
set laststatus=1

" display the current line and col at all times
set ruler

" Set/unset line wrap at the edge of the screen
"set nowrap
set wm=10

" default tabstop of 4 spaces
set ts=4

" default shiftwidth of 4 spaces
set sw=4

" Show matching brace if it's on the screen
set showmatch

" Show INSERT/REPLACE modes
set showmode

" allow tilde (~) to act as an operator -- ~w, etc.
"set tildeop

" set the make program for this program
if has("Win32")
  set makeprg=nmake
endif

if has("gui")
  " set the gui options to:
  "   g: grey inactive menu items
  "   m: display menu bar
  "   r: display scrollbar on right side of window
  "   b: display scrollbar at bottom of window
  "   t: enable tearoff menus on Win32
  "   T: enable toolbar on Win32
  set go=gmrbtT
endif

" Don't use Ex mode, use Q for formatting
map Q gq

" Paragraph formatting with Par <www.cs.berkeley.edu/~amc/Par>
map <F2> j{!}par
}

" make tab in v mode work like I think it should (keep highlighting):
vmap <tab> >gv
vmap <s-tab> <gv

" Date/Time stamps
iab xstamp  <C-R>=strftime("%a %b %d %H:%M:%S %Y %Z")<CR>
iab lastmod  <C-R>="Last Modified: " . strftime("%a %b %d %H:%M:%S %Y %Z")<CR>

" When starting to edit a file:
"   For *.c and *.h files set formatting of comments and set C-indenting on
"   For other files switch it off
"   Don't change the sequence, it's important that the line with * comes first.
autocmd BufRead * set formatoptions=tcql nocindent comments&
autocmd BufRead *.c,*.ec,*.cpp,*.h,*.pl,*.pm set sm formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://

if &term == "vt100" || &term == "vt102" || &term == "linux-m"
   set background=dark
   set term=xterm
endif

if &term=="xterm"
     set t_Co=8
     set t_Sb=^[4%dm
     set t_Sf=^[3%dm
endif

" Set the location of my syntax overrides and read the defaults
let mysyntaxfile =   "e:/vim/usersyntax.vim"
let myfiletypefile = "e:/vim/userfiletype.vim"

" Enable syntax highlighting
syntax on

" Allow user config files in all directories
set exrc
