For pathogen et al
git-svn-id: http://photonzero.com/dotfiles/trunk@66 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
96a93bce9e
commit
1a5fce02ca
1 changed files with 76 additions and 37 deletions
113
.vimrc
113
.vimrc
|
|
@ -1,16 +1,26 @@
|
||||||
set nocompatible
|
set nocompatible
|
||||||
|
|
||||||
|
" Set syntax and highlighting
|
||||||
syntax on
|
syntax on
|
||||||
"colorscheme slate
|
"colorscheme slate
|
||||||
"colorscheme dante
|
"colorscheme dante
|
||||||
colorscheme baraknew
|
colorscheme baraknew
|
||||||
|
|
||||||
|
" Set default spacing
|
||||||
"set gfn=Monaco:h12:a
|
"set gfn=Monaco:h12:a
|
||||||
set ts=8
|
set ts=8
|
||||||
set softtabstop=8
|
set softtabstop=2
|
||||||
set shiftwidth=8
|
set shiftwidth=2
|
||||||
"set expandtab
|
set expandtab
|
||||||
|
|
||||||
|
filetype off
|
||||||
|
call pathogen#runtime_append_all_bundles()
|
||||||
|
filetype plugin indent on
|
||||||
|
" Set 'smart' things in Vim
|
||||||
set smartcase
|
set smartcase
|
||||||
set autoindent
|
set autoindent
|
||||||
set smartindent
|
set smartindent
|
||||||
|
set cindent
|
||||||
set hidden
|
set hidden
|
||||||
set backspace=indent,eol,start
|
set backspace=indent,eol,start
|
||||||
|
|
||||||
|
|
@ -19,16 +29,25 @@ set wildmenu
|
||||||
set wildmode=list:longest
|
set wildmode=list:longest
|
||||||
set ruler
|
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/supertab.vim
|
||||||
"source ~/.vim/charm.vim
|
"source ~/.vim/charm.vim
|
||||||
"source ~/.vim/plugin/AppleT.vim
|
"source ~/.vim/plugin/AppleT.vim
|
||||||
runtime macros/matchit.vim
|
runtime macros/matchit.vim
|
||||||
|
|
||||||
|
" Completion features (TODO: Add to filetype.vim)
|
||||||
au BufNewFile,BufRead motd.public,/tmp/motd.public.r.* setf motd
|
|
||||||
"Highlighting features
|
|
||||||
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
|
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
|
||||||
autocmd FileType python set tags+=$HOME/.vim/tags/python.ctags
|
autocmd FileType python set tags+=$HOME/.vim/tags/python.ctags
|
||||||
"autocmd FileType python set omnifunc=pythoncomplete#Complete
|
"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 python_highlight_all = 1
|
||||||
let g:Tb_MaxSize=0
|
let g:Tb_MaxSize=0
|
||||||
let g:Tb_MapCTabSwitchBufs = 1
|
let g:Tb_MapCTabSwitchBufs = 1
|
||||||
au Filetype html,xml,xsl source ~/.vim/closetag.vim
|
|
||||||
|
|
||||||
"filetype plugin on
|
|
||||||
|
|
||||||
|
|
||||||
"MiniBufExplore Options
|
"MiniBufExplore Options
|
||||||
|
|
@ -49,11 +65,6 @@ au Filetype html,xml,xsl source ~/.vim/closetag.vim
|
||||||
"let g:miniBufExplForceSyntaxEnable = 1
|
"let g:miniBufExplForceSyntaxEnable = 1
|
||||||
|
|
||||||
|
|
||||||
set t_Co=256
|
|
||||||
set t_Sf=ESC[3%dm
|
|
||||||
set t_Sb=ESC[4%dm
|
|
||||||
"set t_kb=
|
|
||||||
|
|
||||||
"Remappings
|
"Remappings
|
||||||
"Open in tabs...
|
"Open in tabs...
|
||||||
"nnoremap gc :tabnew<CR>
|
"nnoremap gc :tabnew<CR>
|
||||||
|
|
@ -87,6 +98,8 @@ inoremap <C-a> <C-O>^
|
||||||
inoremap <C-e> <C-O>$
|
inoremap <C-e> <C-O>$
|
||||||
imap <C-c> <Esc>
|
imap <C-c> <Esc>
|
||||||
|
|
||||||
|
|
||||||
|
" Commentary? Maybe remove these, I rarely use them
|
||||||
" , #perl # comments
|
" , #perl # comments
|
||||||
map ,# :s/^/#/<CR>
|
map ,# :s/^/#/<CR>
|
||||||
" , #mako ## comments
|
" , #mako ## comments
|
||||||
|
|
@ -101,16 +114,23 @@ map ,< :s/^\(.*\)$/<!-- \1 -->/<CR><Esc>:nohlsearch<CR>
|
||||||
" c++ java style comments
|
" c++ java style comments
|
||||||
map ,* :s/^\(.*\)$/\/\* \1 \*\//<CR><Esc>:nohlsearch<CR>
|
map ,* :s/^\(.*\)$/\/\* \1 \*\//<CR><Esc>:nohlsearch<CR>
|
||||||
|
|
||||||
|
" Useful functions
|
||||||
|
|
||||||
|
" Add capital W so I can be lazy about my shift jey
|
||||||
if !exists(":W")
|
if !exists(":W")
|
||||||
command W :w
|
command W :w
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Save a vim session! Useful if you want to save buffer states and so on
|
||||||
command SaveSession :mksession! ~/.vim_last_session
|
command SaveSession :mksession! ~/.vim_last_session
|
||||||
command LoadSession :source ~/.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
|
command ScratchOpen :e scp://barak@barakmich.com//home/barak/notes/scratch
|
||||||
|
" Sudo-make-me-a-sandwich write
|
||||||
command Wdammit :w !sudo tee %
|
command Wdammit :w !sudo tee %
|
||||||
|
|
||||||
|
" Doesn't quite work right but can be a real savior if needed
|
||||||
function! s:DiffWithSaved()
|
function! s:DiffWithSaved()
|
||||||
let filetype=&ft
|
let filetype=&ft
|
||||||
diffthis
|
diffthis
|
||||||
|
|
@ -120,28 +140,7 @@ function! s:DiffWithSaved()
|
||||||
endfunction
|
endfunction
|
||||||
com! DiffSaved call s:DiffWithSaved()
|
com! DiffSaved call s:DiffWithSaved()
|
||||||
|
|
||||||
"cd ~/work/gd/trunk
|
" Forget where I found this...
|
||||||
|
|
||||||
"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
|
|
||||||
"
|
|
||||||
function! Find(name)
|
function! Find(name)
|
||||||
let l:_name = substitute(a:name, "\\s", "*", "g")
|
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$_\"'")
|
"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
|
execute ":e ".l:line
|
||||||
endfunction
|
endfunction
|
||||||
command! -nargs=1 Find :call Find("<args>")
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue