Skip to content

Instantly share code, notes, and snippets.

@ravelll
Created July 2, 2014 04:42
Show Gist options
  • Save ravelll/e06f4d930ce9a23e1919 to your computer and use it in GitHub Desktop.
Save ravelll/e06f4d930ce9a23e1919 to your computer and use it in GitHub Desktop.
Zsh script to show and select rake tasks using peco.
function peco_select_rake_task_all() {
local tasks="bundle exec rake -AT"
task=$(eval $tasks | peco --query "$LBUFFER" )
task_split=("${(s/ /)task}")
BUFFER=$task_split[1,2]
CURSOR=$#BUFFER
zle -R -c
}
zle -N peco_select_rake_task_all
function peco_select_rake_task() {
local tasks="bundle exec rake -T"
task=$(eval $tasks | peco --query "$LBUFFER" )
task_split=("${(s/ /)task}")
BUFFER=$task_split[1,2]
CURSOR=$#BUFFER
zle -R -c
}
zle -N peco_select_rake_task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment