" 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'
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
nnoremap <silent> <leader>gs :Gstatus<CR>
nnoremap <silent> <leader>gd :Gdiff<CR>
-nnoremap <silent> <leader>gc :tab Gcommit -v<CR>
+nnoremap <silent> <leader>gc :Gcommit -v<CR>
nnoremap <silent> <leader>ga :Gwrite<cr>
nnoremap <silent> <leader>gb :Gblame<cr>
\ 'direction': 'botright'
\ })
+nnoremap [unite] <Nop>
+nmap <leader>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 <silent> [unite]a :<C-u>Unite grep -input=\12\17<CR>
-nnoremap [unite] <Nop>
-nmap <leader>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 <silent> [unite]f :<C-u>Unite -start-insert file_rec/async<CR>
+
+" unite-buffer {{{3
call unite#custom#default_action('buffer', 'goto')
nnoremap <silent> [unite]b :<C-u>Unite buffer<CR>
-nnoremap <silent> [unite]a :<C-u>Unite grep -input=\12\17<CR>
+
+" 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 <Leader>gs' : 'Gstatus',
+ \ 'Gcommit -v <Leader>gc' : 'Gcommit -v',
+ \ 'Glog' : 'Glog',
+ \}
+
+nnoremap <silent> <leader>gg :<C-u>Unite menu:fugitive<CR>
+
+let g:unite_source_history_yank_enable = 1
+nnoremap <silent> [unite]p :<C-u>Unite history/yank<CR>
" yankring {{{2
nnoremap <silent> <leader>p :YRShow<cr>
nmap <leader>ef :call EditConfig('ftplugin')<CR>
nmap <leader>es :call EditConfig('syntax')<CR>
nmap <leader>ei :call EditConfig('indent')<CR>
-nmap <leader>eu :UltiSnipsEdit<CR>
+nmap <leader>eu :UltiSnipsEdit<CR>:lcd %:p:h<CR>
" spell check {{{2
" http://tex.stackexchange.com/a/52932