Created
February 28, 2016 18:02
-
-
Save ykhs/fd4ebe7c06b62fcb5ab5 to your computer and use it in GitHub Desktop.
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_branch | |
set -l query (commandline) | |
if test -n $query | |
set peco_flags --query "$query" | |
end | |
git branch | peco --prompt "GIT BRANCH>" $peco_flags | sed -e "s/^\* //g" -e "s/^ //g" | read line | |
if [ $line ] | |
git checkout $line | |
commandline -f repaint | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment