]> oss.titaniummirror.com Git - smckown/dotfiles.git/blobdiff - vim/vimrc
vim: add unite plugin
[smckown/dotfiles.git] / vim / vimrc
index 39154607ea1c619e8eff78be1aaee957495df47d..4c2547318ce43b0ff74ac46e4e0b74d7224b660c 100644 (file)
--- 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<CR>
 
 " mkbuild tools
 nnoremap <silent> <leader>e :call mkbuild#DmenuOpen('e')<CR>
+nnoremap <silent> <leader>x :call mkbuild#SelectXrefs()<CR>
 
 " Turn on doxygen syntax highlighting for C, C++, C# and IDL files.
 let g:load_doxygen_syntax=1
@@ -399,6 +404,28 @@ endfunction
 
 " Insert date and time in insert mode.  Have to use the native <Leader>, not
 " its re-mapped version <space>
-imap <leader>d <C-R>=strftime("%Y%m%d")<CR>
-imap <leader>D <C-R>=strftime("%Y-%m-%d")<CR>
-imap <leader>t <C-R>=strftime("%H:%M:%S")<CR>
+"nmap <leader>dd "=strftime('%Y%m%d')<CR>p
+"imap <leader>dd <C-R>=strftime('%Y%m%d')<CR>
+"nmap <leader>dD "=strftime('%Y-%m-%d')<CR>p
+"imap <leader>dD <C-R>=strftime('%Y-%m-%d')<CR>
+"nmap <leader>dt "=strftime('%H:%M:%S')<CR>p
+"imap <leader>dt <C-R>=strftime('%H:%M:%S')<CR>
+
+" Unite
+let g:unite_source_history_yank_enable = 1
+"call unite#filters#matcher_default#use(['matcher_fuzzy'])
+nnoremap <leader>uf :<C-u>Unite -no-split -start-insert -buffer-name=files file_rec<cr>
+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>
+
+" 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 <buffer> <C-n> <Plug>(unite_select_next_line)
+  imap <buffer> <C-p> <Plug>(unite_select_previous_line)
+  nmap <buffer> <ESC> <Plug>(unite_exit)
+endfunction