]> oss.titaniummirror.com Git - smckown/dotfiles.git/blobdiff - vim/vimrc
vim: add change option toggle for Git Gutter (cog)
[smckown/dotfiles.git] / vim / vimrc
index b4ea160860614eb93cf03956f483eb7d05b4ae8d..f5e903ddb18027e663c4cfe90cf869127b97b6e6 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -75,6 +75,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 +218,7 @@ nnoremap <silent> <leader>gs :Gstatus<CR>
 nnoremap <silent> <leader>gd :Gdiff<CR>
 nnoremap <silent> <leader>gc :Gcommit<CR>
 nnoremap <silent> <leader>gb :Gblame<CR>
-nnoremap <silent> <leader>gl :Glog<CR>
+nnoremap <silent> <leader>gl :Git log<CR>
 nnoremap <silent> <leader>gp :Git push<CR>
 nnoremap <silent> <leader>gr :Gread<CR>
 nnoremap <silent> <leader>gw :Gwrite<CR>
@@ -353,9 +355,12 @@ nnoremap cop :DelimitMateSwitch<CR>
 " Rainbow Parenthesis -- off by default but set toggle
 nnoremap co( :RainbowParenthesesToggle<CR>
 
+" Toggle git gutter
+nnoremap cog :GitGutterToggle<CR>
+
 " mkbuild tools
 nnoremap <silent> <leader>e :call mkbuild#DmenuOpen('e')<CR>
-nnoremap <silent> <leader>x :call mkbuild#SelectXrefs()<CR>
+nnoremap <leader>x :<C-u>Unite -buffer-name=xrefs xrefs<cr>
 
 " Turn on doxygen syntax highlighting for C, C++, C# and IDL files.
 let g:load_doxygen_syntax=1
@@ -418,15 +423,19 @@ nnoremap <leader>uf :<C-u>Unite -no-split -start-insert -buffer-name=files file_
 nnoremap <leader>uy :<C-u>Unite -no-split -buffer-name=yank history/yank<cr>
 nnoremap <leader>ub :<C-u>Unite -no-split -start-insert -buffer-name=buffer buffer<cr>
 nnoremap <leader>uo :<C-u>Unite -no-split -start-insert -buffer-name=outline outline<cr>
+nnoremap <leader>ul :<C-u>Unite -no-split -start-insert -buffer-name=lines line<cr>
+nnoremap <leader>: :<C-u>Unite -start-insert -direction=dynamicbottom -buffer-name=command history/command<cr>
+nnoremap <leader>/ :<C-u>Unite -start-insert -direction=dynamicbottom -buffer-name=search history/search<cr>
 
 " 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 <buffer> <C-n> <Plug>(unite_select_next_line)
   imap <buffer> <C-p> <Plug>(unite_select_previous_line)
+  imap <buffer> <CR> <Plug>(unite_do_default_action)
   nmap <buffer> <ESC> <Plug>(unite_exit)
 endfunction