X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=vim%2Fvimrc;h=11dc04114584043e39a60179ed5b6d0dcdb4e428;hb=1e5ec194036a4b7d3f32ac7f9d41a15e52cb12fe;hp=344e5732fd4f8439d72312eb4fd2e345b86cc886;hpb=7be7c4895081c29d848853149f95d19f12df4cb7;p=smckown%2Fdotfiles.git diff --git a/vim/vimrc b/vim/vimrc index 344e573..11dc041 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -70,6 +70,9 @@ set list " Set default indent policy. smarttab, roundshift enabled by sensible set softtabstop=2 shiftwidth=2 expandtab +" cinoptions for code formatting +set cinoptions=t0,U1,k2s,j1,J1 + " File type specific settings. if has("autocmd") autocmd filetype make setlocal sts=0 sw=8 noexpandtab tw=80 fo-=t fo+=j @@ -77,9 +80,10 @@ if has("autocmd") autocmd filetype python setlocal sts=4 sw=4 tw=79 fo-=t fo+=j autocmd filetype html,xml setlocal listchars-=tab:>. tw=80 fo-=t fo+=j autocmd filetype markdown,mkd,md setlocal tw=80 fo-=t fo+=j - autocmd filetype c,cpp,java setlocal tw=80 fo-=t fo+=j - autocmd filetype nesc setlocal syntax=c.doxygen tw=80 fo-=t fo+=j + autocmd filetype c,cpp,java setlocal tw=80 fo+=jt + autocmd filetype nesc setlocal syntax=c.doxygen tw=80 fo+=jt autocmd filetype text setlocal tw=80 fo+=jt + autocmd filetype tex setlocal tw=80 fo+=jt autocmd BufReadPre README*,TODO*,INSTALL* setlocal tw=80 fo+=t @@ -351,6 +355,7 @@ nnoremap co( :RainbowParenthesesToggle " mkbuild tools nnoremap e :call mkbuild#DmenuOpen('e') +nnoremap x :Unite -buffer-name=xrefs xrefs " Turn on doxygen syntax highlighting for C, C++, C# and IDL files. let g:load_doxygen_syntax=1 @@ -405,3 +410,24 @@ endfunction "imap dD =strftime('%Y-%m-%d') "nmap dt "=strftime('%H:%M:%S')p "imap dt =strftime('%H:%M:%S') + +" Unite +let g:unite_source_history_yank_enable = 1 +"call unite#filters#matcher_default#use(['matcher_fuzzy']) +nnoremap uf :Unite -no-split -start-insert -buffer-name=files file_rec +nnoremap uy :Unite -no-split -buffer-name=yank history/yank +nnoremap ub :Unite -no-split -start-insert -buffer-name=buffer buffer +nnoremap uo :Unite -no-split -start-insert -buffer-name=outline outline + +" Custom mappings for the unite buffer +autocmd FileType unite call s:unite_settings() +function! s:unite_settings() + "setlocal noswapfile undolevels=-1 + " Play nice with supertab + let b:SuperTabDisabled=1 + " Enable navigation with control-j and control-k in insert mode + imap (unite_select_next_line) + imap (unite_select_previous_line) + imap (unite_do_default_action) + nmap (unite_exit) +endfunction