" sourced by Janus set tabstop=4 set shiftwidth=4 set softtabstop=4 autocmd FileType * map ,t :w map ,m :w\|:make map ,- :nohl " Set the indent to 2 when working with ruby and markup stuff autocmd BufNew,BufRead *.feature,*.rb,*.ru,*.xml,*.html,*.htm,Gemfile,Rakefile,Procfile set shiftwidth=2 \| set tabstop=2 \| set softtabstop=2 autocmd FileType ruby set shiftwidth=2 \| set tabstop=2 \| set softtabstop=2 \| map ,t :RuboCop:w autocmd FileType ruby map ,r :RuboCop autocmd BufNew,BufRead *.ino,*.pde setf arduino autocmd FileType arduino set tabstop=4 \| set softtabstop=4 \| let g:syntastic_cpp_check_header=0 \| map ,t :w:execute '!astyle' shellescape(expand('%'), 1):e:make " Set up some sane java compilation bits autocmd BufNew,BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%# \| set makeprg=ant\ -find\ build.xml " never expand tabs (multiline-strings) and remap ',t' to do :Fmt first in Go autocmd FileType go set noexpandtab \| map ,t :Fmt:w " add color column for a few file types autocmd FileType go,python,ruby set colorcolumn=80 " highlighting sbt as scala, too autocmd BufNew,BufRead *.sbt set syn=scala " (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() " astyle the whole thing map ,a :execute '!astyle' shellescape(expand('%'), 1):e " 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 go 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 colorscheme molokai endif let g:valgrind_arguments='--leak-check=yes --num-callers=50'