mico /.vimrc

I transitioned to MacVim but I kept some of my tty and screen 256 color, mouse and mouse scoll support in the file (some commented)
set nocompatible        " we don't need vi compatibility, give us all of vim
set nomodeline		" do not parse embedded modelines (see: CVE-2007-2438)

if (&t_Co >= 256)
	set background=dark
	color peaksea

set lazyredraw		" don't redraw when running macros
set ttyfast		" fast local tty

set novisualbell	" no visual bell
set noeb		" no error bell *only slightly more annoying than visual bells*

set history=100		" keep some history

set clipboard=unnamed	" Uses OS clipboard (shares clipboard accross vim instances)

set noeol		" Don't automatically insert EOL at EOF

set backspace=indent,eol,start " backspace over autoident, EOL, and start of insert

set number		" line numbers

set hlsearch		" highlight search matches
set incsearch		" incremental search (jump to partial match)

set smartcase		" if I put case variation in my search, it's cause I care
set showmatch		" show matching brackets

set scrolloff=8		" keep at least this many lines above/below cursor
set sidescrolloff=5	" keep at least this many columns left/right of cursor

set grepprg=ack		" ack is smarter

set showmode		" vim lets us know which mode we're in
set showcmd		" show partial command in last line of screen
set shortmess+=rnixnm	" shorter messages

set statusline=%F%m%r%h%w\ [%Y:%{&ff}]\ [A=\%03.3b]\ [0x=\%02.2B]\ [%l/%L,%v][%p%%]\ %{$PYTHONPROJECT}
set laststatus=2 " make the last line where the status is two lines deep so you can see status always
" use termcap
"set t_ti=
"set t_te=

set ttymouse=xterm2	" enable mouse in terminal
set mouse=a		" enable mouse in all modes

set wildmenu		" enable wildmenu
set wildmode=list:longest,full
set wildchar=<tab>

" change default auto-complete menu colors
highlight Pmenu ctermfg=1 ctermbg=4 guibg=grey30

" do not complete on these
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.cmi,.cmo,.swo

"set nofoldenable
"set foldmethod=marker

set path=~/projects/**
set tags+=TAGS

let maplocalleader=','

cwindow 30		" size of error window

let g:allml_global_maps = 1 

let g:netrw_list_hide = ".*\.pyc$,^darcs.*,.*patch$,_darcs,_session_records,savior.egg-info,\.svn,\.hg,\.git"
let g:netrw_noretmap = 1 " do not make double click return to netrw browser

if has("autocmd")
	filetype plugin indent on
	syntax on

	" mako templates
	au! BufRead,BufNewFile *.mtpl		setfiletype mako
	au BufWinEnter *.mtpl setfiletype mako
	au! BufRead,BufNewFile *.mako		setfiletype mako
	au BufWinEnter *.mako setfiletype mako

	" for Perl programming, have things in braces indenting themselves:
	autocmd FileType perl set smartindent

	" for CSS, also have things in braces indented:
	autocmd FileType css set smartindent

	" for HTML, generally format text, but if a long line has been created leave it
	" alone when editing:
	autocmd FileType html set formatoptions+=tl

	" for both CSS and HTML, use genuine tab characters for indentation, to make
	" files a few bytes smaller:
	autocmd FileType html,css set noexpandtab tabstop=2

	" For PHP we use 8 tabstops and real tab characters
	autocmd FileType php set noexpandtab tabstop=8

	" in makefiles, don't expand tabs to spaces, since actual tab characters are
	" needed, and have indentation at 8 chars to be sure that all indents are tabs
	" (despite the mappings later):
	autocmd FileType make set noexpandtab shiftwidth=8

	" for Python
	autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab shiftround softtabstop=4 autoindent foldenable smartindent cinwords=if,elif,else,for,while,with,try,except,finally,def,class
	"autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
	"autocmd FileType python setlocal omnifunc=pysmell#Complete

	au FileType svn setlocal spell tw=76
	au FileType git setlocal spell tw=76

	au BufRead /tmp/mutt-* set tw=72

"	set viewdir=~/.vim/.views
"	au VimLeave * mksession! ~/.vim/.sessions/session.vim
"	au BufWinLeave *.py mkview
"	au BufWinEnter *.py silent loadview
"	au BufWinLeave *.mako mkview
"	au BufWinEnter *.mako silent loadview
"	au BufWinLeave *.html mkview
"	au BufWinEnter *.html silent loadview

"	au BufWinLeave *.htm mkviewmap <C-right> <ESC>:bn<CR> 
"	au BufWinEnter *.htm silent loadviewmap <C-left> <ESC>:bp<CR>

" CTRL_R register example
" imap <C-j>d <c-r>=system('~/bin/unittests')<cr>

" nnoremap <silent> <F8> :TlistToggle<CR>

" scroll mouse button map
" map <M-Esc>[62~ <MouseDown>
" map! <M-Esc>[62~ <MouseDown>
" map <M-Esc>[63~ <MouseUp>
" map! <M-Esc>[63~ <MouseUp>
" map <M-Esc>[64~ <S-MouseDown>
" map! <M-Esc>[64~ <S-MouseDown>
" map <M-Esc>[65~ <S-MouseUp>
" map! <M-Esc>[65~ <S-MouseUp>
" " numpad fixup
"imap ^[Oq 1
"imap ^[Or 2
"imap ^[Os 3
"imap ^[Ot 4
"imap ^[Ou 5
"imap ^[Ov 6
"imap ^[Ow 7
"imap ^[Ox 8
"imap ^[Oy 9
"imap ^[Op 0
"imap ^[On .
"imap ^[OQ /
"imap ^[OR *
"imap ^[Ol +
"imap ^[OS -

function! OnlineDoc() 
        " let s:browser = "firefox"
        let s:browser = "lynx"
        let s:wordUnderCursor = expand("<cword>") 

        if &ft == "cpp" || &ft == "c" || &ft == "ruby" || &ft == "php" || &ft == "python" 
                let s:url = "http://www.google.com/codesearch?q=".s:wordUnderCursor."+lang:".&ft
        elseif &ft == "vim"
                let s:url = "http://www.google.com/codesearch?q=".s:wordUnderCursor

        let s:cmd = "silent !" . s:browser . " " . s:url 
        "echo  s:cmd 
        execute  s:cmd 

" online doc search 
map <LocalLeader>k :call OnlineDoc()<CR>

" hightlight spaces at end of lines
highlight WhitespaceEOL ctermbg=red guibg=red
match WhitespaceEOL /\s\+$/
" This will highlight spaces before a tab:
highlight RedundantSpaces ctermbg=red guibg=red
match RedundantSpaces /\s\+$\| \+\ze\t/