set nocompatible set magic let mapleader = "," set t_Co=256 colorscheme railscasts set grepprg=ack\ -H\ --nocolor\ --nogroup set grepformat=%f:%l:%m function! Ack(args) let grepprg_bak=&grepprg set grepprg=ack\ -H\ --nocolor\ --nogroup execute "silent! grep " . a:args botright copen let &grepprg=grepprg_bak endfunction command! -nargs=* -complete=file Ack call Ack() map f :Ack " Fuzzy Finder Textmate settings let g:fuzzy_roots=["app", "config", "db", "features", "lib", "public", "spec", "test", "vendor"] let g:fuzzy_matching_limit=200 let g:fuzzy_ceiling=10000 let g:fuzzy_ignore="teamsite;tags;*.log;*.jpg;*.gif;*.png;.git/**/*;.svn;.svn/**/*;" map t :FuzzyFinderTextMate map :FuzzyFinderTag map b :FuzzyFinderBuffer map ] :FuzzyFinderMruFile map q :BufO map r :Rake " folding settings set foldmethod=indent set foldnestmax=10 set nofoldenable set foldlevel=1 " set to use 'par' for formatting set formatprg=par\ -w72qrg " Minibuffer Explorer Settings let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplMapWindowNavArrows = 1 let g:miniBufExplMapCTabSwitchBufs = 1 let g:miniBufExplModSelTarget = 1 " Change which file opens after executing :Rails command let g:rails_default_file='config/database.yml' syntax on set wildmenu set autoread set nobackup set nowritebackup set smartindent set gdefault set cursorline set nu " Line numbers on set nowrap " Line wrapping off set directory=/tmp " Visual set showmatch " Show matching brackets. set mat=5 " Bracket blinking. set list " Show $ at end of line and trailing space as ~ set lcs=tab:\ \ ,eol:$,trail:~,extends:>,precedes:< set novisualbell " No blinking . set noerrorbells " No noise. set laststatus=2 " Always show status line. " don't use folder browser when adding to project listings let g:proj_flags='imst' " no menu, and no toolbar: "set guioptions-=m set guioptions-=T set term=xterm-256color " os x backspace fix set backspace=indent,eol,start "set t_kb fixdel " tabs -> spaces set expandtab set tabstop=2 set softtabstop=2 set shiftwidth=2 " turn mouse on set mouse=a " space = pagedown, - = pageup noremap noremap - " remap'd keys "map w nnoremap :set invhls hls? " use f5f5 to toggle search hilight nnoremap :set invwrap wrap? " use f4f4 to toggle wordwrap nnoremap :vsplit nnoremap w map :%s/[ ^I]*$//:retab " remove trailing space and retab map ^cw " change first word on line nmap s :source ~/.vimrc nmap v :e ~/.vimrc nnoremap d :NERDTreeToggle nnoremap :TlistToggle " backup to ~/.tmp "set backup "set backupdir=$HOME/.tmp "set writebackup " misc "set ai set nohls set incsearch set showcmd set nowrap let html_use_css=1 " set up pathogen to allow plugin bundling filetype off " following line is needed for vim-pathogen to be a submodule too set runtimepath+=~/home/vim-pathogen call pathogen#runtime_append_all_bundles() " following line is for ervandew's plugins (including supertab etc) set rtp+=~/home/ervandew-vimfiles/vim filetype on " Enable filetype detection filetype indent on " Enable filetype-specific indenting filetype plugin on " Enable filetype-specific plugins 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() let g:snippets_dir='~/home/vim/bundle/snipmate-snippets,~/home/vim/ldb-snippets' " vimwiki options let g:vimwiki_list = [{ 'path': '~/vimwiki/', 'ext': '.txt' }] " svn blame vmap b :!svn blame =expand("%:p") \| sed -n =line("'<") ,=line("'>") p vmap g :!git blame =expand("%:p") \| sed -n =line("'<") ,=line("'>") p " svn log vmap l :!svn log =expand("%:p") " Edit routes command! Rroutes :Redit config/routes.rb command! RTroutes :RTedit config/routes.rb " Edit factories command! Rblueprints :Redit spec/blueprints.rb command! RTblueprints :RTedit spec/blueprints.rb