X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/ccfca081bc71456eb4eef5dcb9b70487ec9ec335..57dd63ffa7e5b7dbdff96acdd23e0e55cf2fafab:/vim/vimrc diff --git a/vim/vimrc b/vim/vimrc index 18cfd6c..bffc315 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -29,6 +29,8 @@ Plugin 'raimondi/delimitmate' " Plugin 'rking/ag.vim' Plugin 'scrooloose/nerdtree' Plugin 'scrooloose/syntastic' +Plugin 'shougo/vimproc.vim' +Plugin 'shougo/unite.vim' Plugin 'sjl/gundo.vim' Plugin 'tomtom/tcomment_vim' Plugin 'tpope/vim-endwise' @@ -63,8 +65,6 @@ Plugin 'justinmk/vim-sneak' Plugin 'chrisbra/checkattach' Plugin 'nathanaelkane/vim-indent-guides' Plugin 'alx741/vinfo' -Plugin 'shougo/vimproc.vim' -Plugin 'shougo/unite.vim' " remove entries first set runtimepath -=$HOME/.vim @@ -428,7 +428,7 @@ autocmd BufReadPost fugitive://* set bufhidden=delete nnoremap gs :Gstatus nnoremap gd :Gdiff -nnoremap gc :tab Gcommit -v +nnoremap gc :Gcommit -v nnoremap ga :Gwrite nnoremap gb :Gblame @@ -517,21 +517,44 @@ call unite#custom#profile('default', 'context', { \ 'direction': 'botright' \ }) +nnoremap [unite] +nmap u [unite] + +" unite-grep {{{3 " seems not respected let g:unite_source_grep_max_candidates = 2000 if executable('ag') - " Use ag in unite rec source - let g:unite_source_rec_async_command = 'ag --follow --nocolor --nogroup --hidden -g ""' " Use ag in unite grep source. let g:unite_source_grep_command = 'ag' let g:unite_source_grep_default_opts = '--smart-case -w --vimgrep --hidden --ignore ''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''' let g:unite_source_grep_recursive_opt = '' end +nnoremap [unite]a :Unite grep -input= -nnoremap [unite] -nmap u [unite] +" unite-file_rec {{{3 +if executable('ag') + " Use ag in unite rec source + let g:unite_source_rec_async_command = 'ag --follow --nocolor --nogroup --hidden -g ""' +end nnoremap [unite]f :Unite -start-insert file_rec/async -nnoremap [unite]a :Unite grep -input= + +" unite-buffer {{{3 +call unite#custom#default_action('buffer', 'goto') +nnoremap [unite]b :Unite buffer + +" unite-menu {{{3 +let g:unite_source_menu_menus = {} +let g:unite_source_menu_menus.fugitive = { 'description' : 'fugitive menu'} +let g:unite_source_menu_menus.fugitive.command_candidates = { + \ 'Gstatus gs' : 'Gstatus', + \ 'Gcommit -v gc' : 'Gcommit -v', + \ 'Glog' : 'Glog', + \} + +nnoremap gg :Unite menu:fugitive + +let g:unite_source_history_yank_enable = 1 +nnoremap [unite]p :Unite history/yank " yankring {{{2 nnoremap p :YRShow @@ -614,7 +637,7 @@ nmap ev :call EditConfig('vimrc') nmap ef :call EditConfig('ftplugin') nmap es :call EditConfig('syntax') nmap ei :call EditConfig('indent') -nmap eu :UltiSnipsEdit +nmap eu :UltiSnipsEdit:lcd %:p:h " spell check {{{2 " http://tex.stackexchange.com/a/52932