VIM profile

Here is a useful record of VIM settings for when I'm away from home base.

" .vimrc
set history=50
set ruler
set tabstop=3
set shiftwidth=3
set smartindent
set autoindent
set undolevels=100
set showmatch
set showcmd
set number
set tw=0

" autowrite buffer on suspend, buffer switch etc...
set autowrite

" vmap sb "zdi<b><C-R>z</b><ESC> : wrap <b></b> around VISUALLY selected Text 
"
syntax on
colorscheme slate

"for scp
set nocp
if version >= 600
    filetype plugin indent on
endif

"date stamps
"Sunday January 02 2008.
iab  dmy  <c-r>=strftime("%A %B %d %Y")<cr>
"20080102
iab  ymd   <c-r>=strftime("%Y%m%d")<cr>
"02:32:22
iab  hms   <c-r>=strftime("%H:%M:%S")<cr> 

" misc abbs

" maps for inserting files
map ,int <ESC>:read ~/neil/docs/job_hunting/cover/intro.txt<CR>
map ,cov <ESC>:read ~/neil/docs/job_hunting/cover/cover-letter.txt<CR>
map ,sig <ESC>:read ~/neil/docs/signatures/resume<CR>

" Rules for different file types.
au BufRead,BufNewFile */journal/*.txt set tw=72 et spell
au BufRead,BufNewFile *.rem set ft=remind
au BufRead,BufNewFile *.cf set ft=cf3
au BufRead,BufNewFile *.xml set ft=xml

"===================================
"PERL SECTION
"===================================

:syntax match xComment /#.*/

"create perl header
map ,ph i!<ESC>:read !which perl<CR>kgJA<CR><CR>use strict;<CR>use warnings;<CR><CR><ESC>ggI#<ESC>G<C-C>

"common DBI statements
iab hashref while ($ref = $sth->fetchrow_hashref){
"iab sth $sth = $dbh->prepare($statement) or die "Couldn't prepare statement: $statement ".$dbh->errstr;<CR>$sth->execute or die "Couldn't execute statement: $statement ".$dbh->errstr;

"===================================
"FUNCTIONS
"===================================
fun! Getchar()
  let c = getchar()
  if c != 0
    let c = nr2char(c)
  endif
  return c
endfun

fun! Eatchar(pat)
   let c = Getchar()
   return (c =~ a:pat) ? '' : c
endfun

" .gvimrc
"font
set guifont=Bitstream\ Vera\ Sans\ Mono\ Bold\ 10

"window size
set guiheadroom=20
"set columns=127
"et lines=58

" remove menus, icons and scrollbars
"set guioptions-=m
set guioptions-=T
set guioptions-=R
set guioptions-=r