How do I use ack or ag within vim with Unite.vim? -
i have found lot of pages config examples such as:
let g:unite_source_grep_command = 'ag' let g:unite_source_grep_default_opts = \ '--line-numbers --nocolor --nogroup --hidden --ignore ' let g:unite_source_grep_recursive_opt = ''
or
" use ag searching let g:unite_source_rec_async_command = \ 'ag --follow --nocolor --nogroup --hidden -g ""' let g:ackprg = 'ag --nogroup --column' nnoremap <space>/ :unite grep:.<cr>
unfortunately, don't understand these doing or why. i've played around , have gotten parts of want working.
ideally, i'd similar ack.vim does:
- i hit key mapping, let's /
- i put in search query
- that opens unite.vim buffer split @ top asynchronously uses ack or ag searches search query
- i can navigate through results , select 1 or open in splits
perhaps i'm missing spirit of question, if need configure unite ag, that's straightforward: in .vimrc add:
let g:unite_source_grep_command="ag" let g:unite_source_grep_default_opts="-i --nocolor --nogroup"
in vim, invoke search so:
:unite grep:. pattern: foobar
note: unite doesn't comes pre-defined mappings, have add own. if unite functionality needs, consider using ack.vim ag (ag.vim no longer maintained.) both plugins fulfill ideal usage patten; unite whole bunch more.
Comments
Post a Comment