Skip to content

Instantly share code, notes, and snippets.

@mhinz
Last active December 10, 2015 23:11
Show Gist options
  • Save mhinz/4b538e2dde94a7936c29 to your computer and use it in GitHub Desktop.
Save mhinz/4b538e2dde94a7936c29 to your computer and use it in GitHub Desktop.
command! Foo call fzf#run({
\ 'source': map(getqflist(), 'bufname(v:val.bufnr).":".v:val.lnum.":".v:val.text'),
\ 'sink': function('<sid>open')
\ })
function! s:open(entry)
let [file, linenr] = matchlist(a:entry, '\v([^:]*):([^:]*)')[1:2]
execute 'edit +'.linenr file
endfunction
autocmd User Grepper Foo
" So we automatically call this if :Grepper finishes:
" :Grepper! -noopen -query foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment