Created
July 2, 2014 04:42
-
-
Save ravelll/e06f4d930ce9a23e1919 to your computer and use it in GitHub Desktop.
Zsh script to show and select rake tasks using peco.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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