" sourced by Janus set tabstop=4 set shiftwidth=4 set softtabstop=4 " Set the indent to 2 when working with ruby and markup stuff autocmd BufNewFile,BufRead *.feature,*.rb,*.ru,*.xml,*.html,*.htm,Gemfile,Rakefile,Procfile set shiftwidth=2 \| set tabstop=2 \| set softtabstop=2 " Set up some sane java compilation bits autocmd BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%# \| set makeprg=ant\ -find\ build.xml map ,t :w map ,m :w\|:make map ,- :nohl " (en|dis)able crosshairs! function! EnableCrosshairs() set cursorline set cursorcolumn highlight CursorLine ctermbg=blue highlight CursorColumn ctermbg=blue endfunction function! DisableCrosshairs() set nocursorline set nocursorcolumn endfunction " MyNext() and MyPrev(): Movement between tabs OR buffers function! MyNext() if exists( '*tabpagenr' ) && tabpagenr('$') != 1 " Tab support && tabs open normal gt else " No tab support, or no tabs open execute ":bnext" endif endfunction function! MyPrev() if exists( '*tabpagenr' ) && tabpagenr('$') != '1' " Tab support && tabs open normal gT else " No tab support, or no tabs open execute ":bprev" endif endfunction " moving between tabs OR buffers nnoremap L :call MyNext() nnoremap H :call MyPrev() " easy indentation in visual mode " This keeps the visual selection active after indenting. " Usually the visual selection is lost after you indent it. vmap > >gv vmap < or \m map :make map m :make " Highlight over 80 chars wide for python files " (to call manually, use the mapping '\py80' map py80 :call LambastOver80Wide() function! LambastOver80Wide() highlight NearLength ctermbg=yellow ctermfg=black match NearLength /\%76v.*/ highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ endfun " disable mapping (to call manually use mapping '\nopy80' map nopy80 :call DisableLambastOver80Wide() function! DisableLambastOver80Wide() highlight OverLength ctermbg=Black ctermfg=white guibg=#000000 endfun " call it right away for certain files autocmd FileType python call LambastOver80Wide() autocmd FileType moin call LambastOver80Wide() " autocmd FileType javascript call LambastOver80Wide() " autocmd FileType actionscript call LambastOver80Wide() autocmd FileType mail call LambastOver80Wide() autocmd FileType scons call LambastOver80Wide() " autocmd FileType cs call LambastOver80Wide() " strip trailing whitespace map SW :call StripTrailingWhitespace() function! StripTrailingWhitespace() :%s/\s\+$//e endfun " remove all ^M chars map SM :call StripCtrlMs() function! StripCtrlMs() :%s/[ \t\r]\+$//e endfun " insert date map D :call InsertDate() function! InsertDate() :read !date endfun if !has('gui_running') set t_Co=256 "colorscheme gardener colorscheme inkpot endif let g:valgrind_arguments='--leak-check=yes --num-callers=50'