X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=vim%2Fvimrc;h=ab4b160229d06d0d29f1244438cd0bfdaf3aa039;hb=61ecab661a886a047c0a01c07c7089c22428ca9c;hp=4c2547318ce43b0ff74ac46e4e0b74d7224b660c;hpb=fa7b2df678cdbd4aa566743b50d5c7ff599c4dcd;p=smckown%2Fdotfiles.git diff --git a/vim/vimrc b/vim/vimrc index 4c25473..ab4b160 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -23,6 +23,9 @@ call pathogen#helptags() runtime! plugin/sensible.vim nnoremap Y Y +" Update wildmenu from sensible defaults +set wildmode=longest:full,full + " Set the correct font for gvim if has("gui_running") if has("gui_gtk2") @@ -75,6 +78,8 @@ set cinoptions=t0,U1,k2s,j1,J1 " File type specific settings. if has("autocmd") + autocmd BufNewFile,BufRead /run/shm/* set nobackup nowritebackup noundofile + \ noswapfile viminfo="" noshelltemp history=0 nomodeline secure autocmd filetype make setlocal sts=0 sw=8 noexpandtab tw=80 fo-=t fo+=j autocmd filetype sh,ld setlocal sts=4 sw=4 tw=80 fo-=t fo+=j autocmd filetype python setlocal sts=4 sw=4 tw=79 fo-=t fo+=j @@ -216,7 +221,7 @@ nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gc :Gcommit nnoremap gb :Gblame -nnoremap gl :Glog +nnoremap gl :Git log nnoremap gp :Git push nnoremap gr :Gread nnoremap gw :Gwrite @@ -314,22 +319,6 @@ nmap 7 AirlineSelectTab7 nmap 8 AirlineSelectTab8 nmap 9 AirlineSelectTab9 -" Highlight only long lines -" This solution has two problems: -" 1. On first file edit, the status bar does not render until a key is pressed -" 2. When creating new lines the last column isn't known until it's arrived -"augroup collumnLimit -" autocmd! -" autocmd BufEnter,WinEnter,FileType scala,java,c,nesc,make -" \ highlight CollumnLimit ctermbg=LightGrey guibg=LightGrey -" let collumnLimit = 79 -" let pattern = -" \ '\%<' . (collumnLimit+1) . 'v.\%>' . collumnLimit . 'v' -" autocmd BufEnter,WinEnter,FileType scala,java,c,nesc,make -" \ let w:m1=matchadd('CollumnLimit', pattern, -1) -"augroup END - -" The simpler solution to the above, which generates a column if exists('+colorcolumn') if v:version >= 703 " Set color column relative to defined textwidth. @@ -350,12 +339,13 @@ let g:delimitMate_expand_space = 1 " cop means to toggle auto pairing nnoremap cop :DelimitMateSwitch -" Rainbow Parenthesis -- off by default but set toggle -nnoremap co( :RainbowParenthesesToggle +" Toggle git gutter +nnoremap cog :GitGutterToggle -" mkbuild tools -nnoremap e :call mkbuild#DmenuOpen('e') -nnoremap x :call mkbuild#SelectXrefs() +" mkbuild code search tools +nnoremap e :Unite -start-insert -buffer-name=files mkbuild/file_xref +nnoremap E :Unite -start-insert -buffer-name=files mkbuild/file +nnoremap x :Unite -buffer-name=xrefs mkbuild/xref " Turn on doxygen syntax highlighting for C, C++, C# and IDL files. let g:load_doxygen_syntax=1 @@ -382,10 +372,10 @@ function! ToggleFormatOptionT() let tmp = substitute(&formatoptions, 't', '', '') if &formatoptions == tmp set fo+=t - :echo "Enable text wrap" + :echo ":set fo+=t" else set fo-=t - :echo "Disable text wrap" + :echo ":set fo-=t" endif endfunction @@ -395,10 +385,10 @@ function! ToggleFormatOptionA() let tmp = substitute(&formatoptions, 'a', '', '') if &formatoptions == tmp set fo+=a - :echo "Enable auto-wrap paragraphs" + :echo ":set fo+=a" else set fo-=a - :echo "Disable auto-wrap paragraphs" + :echo ":set fo-=a" endif endfunction @@ -417,15 +407,22 @@ let g:unite_source_history_yank_enable = 1 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 +nnoremap ul :Unite -no-split -start-insert -buffer-name=lines line +nnoremap uc :Unite -no-split -start-insert -buffer-name=quicklist qf +nnoremap ut :Unite -no-split -start-insert -buffer-name=tags tag +nnoremap : :Unite -start-insert -buffer-name=command history/command +nnoremap / :Unite -start-insert -buffer-name=search history/search " Custom mappings for the unite buffer autocmd FileType unite call s:unite_settings() function! s:unite_settings() - setlocal noswapfile undolevels=-1 + "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