m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-20 09:33:42 -05:00

Slight improvement of ag wrapper, to list file contexts BEFORE the filename in the list passed to fzf

gleachkr
2014-07-03 09:48:14 -07:00
parent 1bf2d2d839
commit 24812166ac

@@ -150,14 +150,18 @@ add this to your .vimrc
```vimL
command! -nargs=1 AgFZF call fzf#run({
\'source': 'ag -i ' . <f-args>,
\'source': Arghandler(<f-args>),
\'sink' : function('AgHandler'),
\'options' : '-m'
\})
function! AgHandler(l)
let keys = split(a:l,':')
execute 'tabe +' . keys[1] . ' ' . keys[0]
execute 'tabe +' . keys[-2] . ' ' . keys[-1]
endfunction
function! Arghandler(l)
return "ag -i " . a:l . " | sed 's@\\(.[^:]*\\):\\(.[^:]*\\):\\(.*\\)@\\3:\\2:\\1@' "
endfunction
```