mirror of
https://github.com/junegunn/fzf.vim.git
synced 2025-12-09 14:04:58 +08:00
@@ -399,14 +399,18 @@ function! s:ag_handler(lines)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" query, [[ag options], options]
|
||||||
function! fzf#vim#ag(query, ...)
|
function! fzf#vim#ag(query, ...)
|
||||||
|
let args = copy(a:000)
|
||||||
|
let ag_opts = len(args) > 1 ? remove(args, 0) : ''
|
||||||
return s:fzf(fzf#vim#wrap({
|
return s:fzf(fzf#vim#wrap({
|
||||||
\ 'source': printf('ag --nogroup --column --color "%s"',
|
\ 'source': printf('ag --nogroup --column --color %s "%s"',
|
||||||
|
\ ag_opts,
|
||||||
\ escape(empty(a:query) ? '^(?=.)' : a:query, '"\-')),
|
\ escape(empty(a:query) ? '^(?=.)' : a:query, '"\-')),
|
||||||
\ 'sink*': s:function('s:ag_handler'),
|
\ 'sink*': s:function('s:ag_handler'),
|
||||||
\ 'options': '--ansi --delimiter : --nth 4..,.. --prompt "Ag> " '.
|
\ 'options': '--ansi --delimiter : --nth 4..,.. --prompt "Ag> " '.
|
||||||
\ '--multi --bind ctrl-a:select-all,ctrl-d:deselect-all '.
|
\ '--multi --bind ctrl-a:select-all,ctrl-d:deselect-all '.
|
||||||
\ '--color hl:68,hl+:110'}), a:000)
|
\ '--color hl:68,hl+:110'}), args)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user