source ~/.vim/vimrc let g:NERDTreeMapOpenSplit = 'i' let g:fuzzy_ignore = "gems*;pkg/*" let g:NERDSpaceDelims = 1 let NERDTreeChDirMode=2 " auto-change CWD when changing tree root command -n=? -complete=dir NT NERDTreeToggle " TODO look up "local leader" for setting up custom local leader " colorscheme twilight2 colorscheme vibrantink " size the window so it fills the macbook screen set columns=181 set lines=53 set gfn=Andale_Mono:h12 set directory=~/.vimswap " set nobackup " set noswapfile set tabstop=2 set softtabstop=2 set shiftwidth=2 syntax on set go-=T " disable the toolbars in macvim set go-=r " disable right-hand scrollbar set go-=L " disable left-hand scrollbar " set go-=e " disable graphical tabs set winheight=10 " current window is a nice height always set winminheight=3 " but the other windows aren't *too* small set number command StripTrailingSpaces :%s/\s\+$//g command Tr :StripTrailingSpaces " set up word wrap stuff set wrap set linebreak set textwidth=120 set wrapmargin=120 " tab mojo from ara " this lets 'tt' toggle between tabs let g:tabno=tabpagenr() au TabLeave * :let g:tabno = tabpagenr() " map tt :exec 'normal !'.g:tabno.'gt' " map 'tn' to tabnext - a count is relative from current pos function TabNext() exec 'tabn' endfunction " map tn :call TabNext() " map j_ " map k_ map j map k map h map l map _ map gt map gT map :call TabMove(1) map :call TabMove(0) " map 'tg' to 'tab go' - this is an absolute tab number and quite useful with 'tt' " map tg gt " map gt " map 'tp' to 'tab previous' " map tp gT " map gT " ctrl-j and ctrl-k move tabs left(j)/right(k) " map :call TabMove(1) " map :call TabMove(1) " map :call TabMove(0) " map :call TabMove(0) function TabMove(n) let nr = tabpagenr() let size = tabpagenr('$') " do we want to go left? if (a:n != 0) let nr = nr - 2 endif " crossed left border? if (nr < 0) let nr = size-1 " crossed right border? elseif (nr == size) let nr = 0 endif " fire move command exec 'tabm'.nr endfunction " settings from jeremy " wildmatching " set wildmode=list:longest " make cmdline tab completion similar to bash " set wildmenu " enable ctrl-n and ctrl-p to scroll through matches " set wildignore=*.o,*.obj,*~ " " completion additions. " set popumen to display longest match on popup even if only one match " set completeopt=menuone,longest " from http://vim.wikia.com/wiki/Change_vimrc_with_auto_reload " autocmd BufWritePost .vimrc source % " from http://pastie.org/359759 / evan phoenix function! CleverTab() if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' return "\" else return "\" endfunction inoremap =CleverTab() " from atmos nnoremap :NERDTreeToggle " redraw the screen nnoremap :nohlsearch inoremap :nohlsearch " formatoptions get overridden by the ftplugin stuff built-ins " see http://peox.net/articles/vimconfig.html for more info " from http://www.oreillynet.com/onlamp/blog/2005/07/vim_its_slim_and_trim_heres_wh.html " function ClosePair(char) " if getline('.')[col('.') - 1] == a:char " return "\" " else " return a:char " endif " endf " inoremap ( ()i " inoremap ) =ClosePair(')') " inoremap { {}i " inoremap } =ClosePair('}') " inoremap [ []i " inoremap ] =ClosePair(']')