はてな記法でfishは使えない。
function peco-git-checkout git branch -a | peco | tr -d ' ' | read branch echo $branch if [ $branch ] if contains $branch "remotes/" set -l b (echo $branch | awk -F'/' '{print $3}') git checkout -b $b $branch else git checkout $branch end end commandline -f repaint end function fish_user_key_bindings bind \cxg peco-git-checkout end
いくつかfish独特の文法があり、commandline -f repaintがそれにあたる。ちょっとほかのpeco系関数を頼りに書いた。 gist.github.com