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',