For pathogen et al

git-svn-id: http://photonzero.com/dotfiles/trunk@66 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
michener 2010-09-22 00:00:10 +00:00
parent 96a93bce9e
commit 1a5fce02ca

113
.vimrc
View file

@ -1,16 +1,26 @@
set nocompatible
" Set syntax and highlighting
syntax on
"colorscheme slate
"colorscheme dante
colorscheme baraknew
" Set default spacing
"set gfn=Monaco:h12:a
set ts=8
set softtabstop=8
set shiftwidth=8
"set expandtab
set softtabstop=2
set shiftwidth=2
set expandtab
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
" Set 'smart' things in Vim
set smartcase
set autoindent
set smartindent
set cindent
set hidden
set backspace=indent,eol,start
@ -19,16 +29,25 @@ set wildmenu
set wildmode=list:longest
set ruler
" Some stuff for console 256 Colors
set t_Co=256
set t_Sf=ESC[3%dm
set t_Sb=ESC[4%dm
"set t_kb=
"
if v:version >= 703
set relativenumber
set colorcolumn=81
endif
"Sources
" Sources
"source ~/.vim/supertab.vim
"source ~/.vim/charm.vim
"source ~/.vim/plugin/AppleT.vim
runtime macros/matchit.vim
au BufNewFile,BufRead motd.public,/tmp/motd.public.r.* setf motd
"Highlighting features
" Completion features (TODO: Add to filetype.vim)
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType python set tags+=$HOME/.vim/tags/python.ctags
"autocmd FileType python set omnifunc=pythoncomplete#Complete
@ -36,9 +55,6 @@ autocmd FileType python set tags+=$HOME/.vim/tags/python.ctags
let python_highlight_all = 1
let g:Tb_MaxSize=0
let g:Tb_MapCTabSwitchBufs = 1
au Filetype html,xml,xsl source ~/.vim/closetag.vim
"filetype plugin on
"MiniBufExplore Options
@ -49,11 +65,6 @@ au Filetype html,xml,xsl source ~/.vim/closetag.vim
"let g:miniBufExplForceSyntaxEnable = 1
set t_Co=256
set t_Sf=ESC[3%dm
set t_Sb=ESC[4%dm
"set t_kb=
"Remappings
"Open in tabs...
"nnoremap gc :tabnew<CR>
@ -87,6 +98,8 @@ inoremap <C-a> <C-O>^
inoremap <C-e> <C-O>$
imap <C-c> <Esc>
" Commentary? Maybe remove these, I rarely use them
" , #perl # comments
map ,# :s/^/#/<CR>
" , #mako ## comments
@ -101,16 +114,23 @@ map ,< :s/^\(.*\)$/<!-- \1 -->/<CR><Esc>:nohlsearch<CR>
" c++ java style comments
map ,* :s/^\(.*\)$/\/\* \1 \*\//<CR><Esc>:nohlsearch<CR>
" Useful functions
" Add capital W so I can be lazy about my shift jey
if !exists(":W")
command W :w
endif
" Save a vim session! Useful if you want to save buffer states and so on
command SaveSession :mksession! ~/.vim_last_session
command LoadSession :source ~/.vim_last_session
" This is a quick way to edit a persistent scratch buffer for me...
command ScratchOpen :e scp://barak@barakmich.com//home/barak/notes/scratch
" Sudo-make-me-a-sandwich write
command Wdammit :w !sudo tee %
" Doesn't quite work right but can be a real savior if needed
function! s:DiffWithSaved()
let filetype=&ft
diffthis
@ -120,28 +140,7 @@ function! s:DiffWithSaved()
endfunction
com! DiffSaved call s:DiffWithSaved()
"cd ~/work/gd/trunk
"if has("cscope")
" set csto=0
" set cst
" set nocsverb
" " add any database in current directory
"if filereadable("~/work/gd/trunk/cscope.out")
" " cs add ~/work/gd/trunk/cscope.out
" if filereadable("cscope.out")
" cs add cscope.out
" " else add database pointed to by environment
" elseif $CSCOPE_DB != ""
" cs add $CSCOPE_DB
" endif
" set csverb
"endif
"inoremap ;a <esc>
"cd /mw/barak/gd-es-bug
"
" Forget where I found this...
function! Find(name)
let l:_name = substitute(a:name, "\\s", "*", "g")
"let l:list=system("find . -iname '*".l:_name."*' -not -name \"*.class\" -and -not -name \"*.swp\" | perl -ne 'print \"$.\\t$_\"'")
@ -173,3 +172,43 @@ function! Find(name)
execute ":e ".l:line
endfunction
command! -nargs=1 Find :call Find("<args>")
" Googley things....
function! HighlightTooLongLines()
highlight def link RightMargin Error
if &textwidth != 0
exec 'match RightMargin /\%<' . (&textwidth + 3) . 'v.\%>' . (&textwidth + 1) . 'v/'
endif
endfunction
let g:google = 0
if filereadable("/usr/share/vim/google/google.vim")
source /usr/share/vim/google/google.vim
let g:google = 1
else
if filereadable("/google/src/head/depot/eng/vim/google.vim")
source /google/src/head/depot/eng/vim/google.vim
let g:google = 1
else
if filereadable("/home/build/public/eng/vim/google.vim")
source /home/build/public/eng/vim/google.vim
let g:google = 1
endif
endif
endif
if g:google != 0
augroup filetypedetect
au WinEnter,BufNewFile,BufRead * call HighlightTooLongLines()
augroup END
endif
if filereadable("/home/build/nonconf/google3/tools/tags/gtags.vim")
source /home/build/nonconf/google3/tools/tags/gtags.vim
nmap <C-]> :exe 'Gtlist ' . expand('<cword>')<CR>
endif