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:

  1. i hit key mapping, let's /
  2. i put in search query
  3. that opens unite.vim buffer split @ top asynchronously uses ack or ag searches search query
  4. 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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -