The plugin fzf.vim defines the following vim command here:
command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, <bang>0)'
the fzt#vim#ag
function seems to allow passing all the ag options to the ag shell command. There is also a comment regarding this
" query, [[ag options], options]
function! fzf#vim#ag(query, ...)
However, no matter how I call it everything is passed as the first parameter query
. I've added bunch of logs to the script
For example, calling
:Ag SearchString -c app
and adding following logs to the above function
" query, [[ag options], options]
function! fzf#vim#ag(query, ...)
if type(a:query) != s:TYPE.string
return s:warn('Invalid query argument')
endif
let query = empty(a:query) ? '^(?=.)' : a:query
let args = copy(a:000)
let ag_opts = len(args) > 1 && type(args[0]) == s:TYPE.string ? remove(args, 0) : ''
let command = ag_opts . ' ' . fzf#shellescape(query)
echo query
echo ag_opts
echo command
return call('fzf#vim#ag_raw', insert(args, command, 0))
endfunction
would print
SearchString -c app
'SearchString -c app'
meaning ag_opts
was empty
So how to pass the other args as a query to this command?