diff --git a/examples.md b/examples.md index 921756a..0715d7e 100644 --- a/examples.md +++ b/examples.md @@ -150,14 +150,18 @@ add this to your .vimrc ```vimL command! -nargs=1 AgFZF call fzf#run({ - \'source': 'ag -i ' . , + \'source': Arghandler(), \'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 ```