" hewbert's .vimrc " Last Modified: Sun 24 Jun 2007 02:10:18 AM EDT set nocompatible " safeguard for re-sourcing autocmd! " Pickup where we left off autocmd BufEnter * :syntax sync fromstart " HACK: I don't want a .gvimrc but some stuff gets reset during GUI init, " therefore re-source .vimrc at GUI start if has("gui") autocmd GUIEnter * source endif set ruler " show the line and column numbers of the cursor "set number set showcmd " show (partial) command in status line set showmode " show current mode set ignorecase " case insensitive matching set linebreak set scrolloff=4 " keep in context when scrolling set noerrorbells visualbell t_vb= " no beeps of any kind set modeline " enable modeline set esckeys " cursor keys in insert mode "set ttyscroll=0 " turn off scrolling (faster) "set ttyfast " fast terminal connection set winminheight=0 set splitbelow set confirm set history=2000 " 100x the default " Do not automatically insert a comment leader after an enter set fo-=r au BufRead * se formatoptions-=cro set incsearch set showmatch set autoindent set smartindent set textwidth=0 set tabstop=4 set shiftwidth=4 set softtabstop=4 set isfname+=/,. "set backspace=2 " indent,eol,start set backspace=indent,eol,start set nojoinspaces "map j "map k "map map map! if exists("&encoding") set fileencodings=utf-8,iso-8859-1 if has("gui_running") set encoding=utf-8 else set encoding=iso-8859-1 endif endif if has("digraphs") digraphs .. 8230 " … digraphs -- 8212 " — endif set mouse=a set nomousehide behave xterm set selectmode=mouse if has("menu") amenu Book&marks.&Plasmasturm.home :e scp://rice/plasmasturm.atom amenu Book&marks.&Plasmasturm.links :e scp://rice/www/links/index.shtml amenu Book&marks.&Plasmasturm.template :e scp://rice/www/template.shtml amenu Book&marks.&Plasmasturm.css :e scp://rice/www/global.css amenu Book&marks.MP&3 :e ~/mp3/LIST amenu Book&marks.Lists :E ~/public_html/lists/ endif " current directory follows the file being edited, so long as it's not a remote file if exists(":lcd") autocmd BufEnter * if bufname("") !~ '^[[:alnum:]]*://' | silent! lcd %:p:h | endif else autocmd BufEnter * if bufname("") !~ '^[[:alnum:]]*://' | cd %:p:h | endif endif if has("gui_running") set columns=130 lines=50 if has("gui_gtk2") set guioptions-=tT "set guifont=Bitstream\ Vera\ Sans\ Mono\ 10 "set guifont=ProFontWindows\ 9 set guifont=Andale\ Mono\ 10 colorscheme desert elseif has("gui_win32") set guioptions-=tT set guifont=Bitstream_Vera_Sans_Mono:h10:cANSI colorscheme murphy endif else " enable Xterm mouse wheel scrolling map [62~ map! [62~ map [63~ map! [63~ map [64~ map! [64~ map [65~ map! [65~ set background=dark if exists(":colorscheme") colorscheme elflord endif endif syntax on if exists(":filetype") filetype plugin indent on runtime ftplugin/man.vim " to have :Man available endif " some servers refuse to respond to user agents they assume to be spiders let g:netrw_http_cmd = "wget -U 'Vim (netrw 6.2)' -O" " for :TOhtml let g:html_use_css = 1 let g:html_use_xhtml = 1 let g:html_number_lines = 1 "imap \fn =expand("%:t:r") let timestamp_rep = "%a %d %b %Y %I:%M:%S %p %Z" autocmd BufNewFile *.php 0r ~/.vim/skel/skel.php "autocmd BufWritePre *.php call FileHead()|'s " FIXME: the following need a better solution autocmd BufNewFile *.html execute "normal I<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\\\title\\\\\\\{" autocmd BufNewFile *.pm,*.pl execute "normal I#!/usr/bin/perl\\use strict\;\use warnings\;\\\jo\" "function FileHead() " let file = 0 " while file < 20 " if getline(file) =~ "CURRENT_FILE" " %s//\=expand("%") " exe file . %s//=expand(%:t:r) " endif " let file = file + 1 " endwhile "endfunction