Skip to content

Instantly share code, notes, and snippets.

@gizmomogwai
Created Aug 17, 2015
Embed
What would you like to do?
select one raketask with fzf in the fish shell
function rt -d "select one rake task"
if rake -T | fzf > $TMPDIR/fzf.result
set fzf_result (cat $TMPDIR/fzf.result | cut -d ' ' -f 2)
set h "rake $fzf_result"
commandline $h
end
end
@gf3
Copy link

gf3 commented Apr 11, 2018

sans temp file & supports multiple tasks:

function rt -d "Fuzzy-find & execute rake tasks"
  set -l tasks (rake -T | fzf -m | cut -d ' ' -f 2 | perl -pe 'if(!eof){s/\n/ /}')
  commandline "rake $tasks"
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment