Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gizmomogwai
Created August 17, 2015 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gizmomogwai/e3cde85564c0eb5aabd4 to your computer and use it in GitHub Desktop.
Save gizmomogwai/e3cde85564c0eb5aabd4 to your computer and use it in GitHub Desktop.
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