Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function peco-git-checkout () {
local selected_branch=$(git branch --list --no-color | colrm 1 2 | peco)
if [ -n "$selected_branch" ]; then
BUFFER="git checkout ${selected_branch}"
zle accept-line
fi
}
zle -N peco-git-checkout
bindkey '^[;^[c' peco-git-checkout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment