set nocompatible syntax on "colorscheme slate "colorscheme dante colorscheme barak "set gfn=Monaco:h12:a set ts=8 set softtabstop=8 set shiftwidth=8 "set expandtab set smartcase set autoindent set smartindent set hidden set backspace=indent,eol,start set history=1000 set wildmenu set wildmode=list:longest set ruler "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 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 "autocmd FileType python call SuperTabSetCompletionType("") 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 "let g:miniBufExplMapWindowNavVim = 1 "let g:miniBufExplMapWindowNavArrows = 1 "let g:miniBufExplMapCTabSwitchBufs = 1 "let g:miniBufExplModSelTarget = 1 "let g:miniBufExplForceSyntaxEnable = 1 set t_Co=16 set t_Sf=ESC[3%dm set t_Sb=ESC[4%dm "set t_kb= "Remappings "Open in tabs... "nnoremap gc :tabnew "nnoremap gK :tabclose "nnoremap gn gt "nnoremap gp gT nmap gt :NERDTreeToggle nnoremap gK :bdelete nnoremap gn :bn nnoremap gp :bp nnoremap gz :pclose nnoremap gw g* nmap P op nnoremap j gj nnoremap k gk xnoremap j gj xnoremap k gk nnoremap gj nnoremap gk xnoremap gj xnoremap gk inoremap gj inoremap gk "nnoremap nnoremap ^ nnoremap $ xnoremap ^ xnoremap $ inoremap ^ inoremap $ imap " , #perl # comments map ,# :s/^/#/ " , #mako ## comments map ,% :s/^/##/ " ,/ C/C++/C#/Java // comments map ,/ :s/^/\/\// " ,< HTML comment map ,< :s/^\(.*\)$//:nohlsearch " c++ java style comments map ,* :s/^\(.*\)$/\/\* \1 \*\//:nohlsearch if !exists(":W") command W :w endif command SaveSession :mksession! ~/.vim_last_session command LoadSession :source ~/.vim_last_session command ScratchOpen :e scp://barak@barakmich.com//home/barak/notes/scratch function! s:DiffWithSaved() let filetype=&ft diffthis vnew | r # | normal! 1Gdd diffthis exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype 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 "cd /mw/barak/gd-es-bug " 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$_\"'") let l:list=system("find . -path \"*/.svn\" -prune -o -iname '*".l:_name."*' -not -name \"*.class\" -and -not -name \"*.swp\" -print | perl -ne 'print \"$.\\t$_\"'") let l:num=strlen(substitute(l:list, "[^\n]", "", "g")) if l:num < 1 echo "'".a:name."' not found" return endif if l:num != 1 echo l:list let l:input=input("Which ? (=nothing)\n") if strlen(l:input)==0 return endif if strlen(substitute(l:input, "[0-9]", "", "g"))>0 echo "Not a number" return endif if l:input<1 || l:input>l:num echo "Out of range" return endif let l:line=matchstr("\n".l:list, "\n".l:input."\t[^\n]*") else let l:line=l:list endif let l:line=substitute(l:line, "^[^\t]*\t./", "", "") execute ":e ".l:line endfunction command! -nargs=1 Find :call Find("")