]> git.rmz.io Git - dotfiles.git/commitdiff
vim: use unite instead of Ag
authorSamir Benmendil <samir.benmendil@gmail.com>
Wed, 22 Apr 2015 13:53:51 +0000 (14:53 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Wed, 22 Apr 2015 17:51:17 +0000 (18:51 +0100)
vim/vimrc

index 9284bf50103126b783d1ce8fd4a3c328c124fcb9..dd4b7b7cec69f1da2024d23fb0f2efb1e33ed6b3 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -26,7 +26,7 @@ Plugin 'wilywampa/python-mode'
 Plugin 'kshenoy/vim-signature'
 Plugin 'majutsushi/tagbar'
 Plugin 'raimondi/delimitmate'
-Plugin 'rking/ag.vim'
+Plugin 'rking/ag.vim'
 Plugin 'scrooloose/nerdtree'
 Plugin 'scrooloose/syntastic'
 Plugin 'sjl/gundo.vim'
@@ -63,6 +63,7 @@ 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
@@ -400,11 +401,6 @@ cnoremap w!! w !sudo tee % > /dev/null
 inoremap <C-C> <Esc>gUiwgi
 
 " plugins options {{{1
-" ag {{{2
-let g:AgSmartCase = 1
-nnoremap <leader>ag yiw:Ag \12"<cr>
-vnoremap <leader>ag y:Ag \12"<cr>
-
 " airline {{{2
 let g:airline#extensions#whitespace#enabled = 1
 let g:airline#extensions#tabline#enabled = 1
@@ -521,9 +517,20 @@ call unite#custom#profile('default', 'context', {
             \ 'winheight': 20,
             \ 'direction': 'botright'
             \ })
-nnoremap    [unite]   <Nop>
-nmap    <leader>u [unite]
+
+" seems not respected
+let g:unite_source_grep_max_candidates = 2000
+if executable('ag')
+    " 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] <Nop>
+nmap <leader>u [unite]
 nnoremap <silent> [unite]f :<C-u>Unite buffer file_rec<CR>
+nnoremap <silent> [unite]a :<C-u>Unite grep -input=\12\17<CR>
 
 " yankring {{{2
 nnoremap <silent> <leader>p :YRShow<cr>