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
@@ -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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user