From 29628c900fb73a3befd14daff5d45ec9490dbd5a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 13 Jul 2015 01:47:09 +0900 Subject: [PATCH] Ag w/o argument --- Examples-(vim).md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Examples-(vim).md b/Examples-(vim).md index 71ac0dc..4fb5eae 100644 --- a/Examples-(vim).md +++ b/Examples-(vim).md @@ -118,6 +118,7 @@ command! FZFLines call fzf#run({ - `CTRL-X`, `CTRL-V`, `CTRL-T` to open in a new split, vertical split, tab respectively. - `CTRL-A` to select all matches and list them in quickfix window +- `Ag` without argument will list all the lines ```vim function! s:ag_to_qf(line) @@ -146,8 +147,9 @@ function! s:ag_handler(lines) endif endfunction -command! -nargs=1 Ag call fzf#run({ -\ 'source': 'ag --nogroup --column --color "'.escape(, '"\').'"', +command! -nargs=* Ag call fzf#run({ +\ 'source': printf('ag --nogroup --column --color "%s"', +\ escape(empty() ? '^' : , '"\')), \ 'sink*': function('ag_handler'), \ 'options': '--ansi --expect=ctrl-t,ctrl-v,ctrl-x '. \ '--multi --bind ctrl-a:select-all --color hl:68,hl+:110',