Created
June 4, 2017 16:55
-
-
Save kechol/8434779270c621c1565922175c43def4 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 __ssh_peco_ctrl_s -d 'Select hosts from ssh config' | |
grep 'Host ' ~/.ssh/config | awk '{print $2}' | peco | read host | |
[ -n "$host" ]; and ssh $host | |
commandline -f repaint | |
end | |
function __git_branch_peco_ctrl_b -d 'Select branch and checkout' | |
git branch | awk '{print $2}' | peco | read branch | |
[ -n "$branch" ]; and git checkout $branch | |
commandline -f repaint | |
end | |
function fish_user_key_bindings | |
bind \cs '__ssh_peco_ctrl_s' | |
bind \cb '__git_branch_peco_ctrl_b' | |
if bind -M insert >/dev/null ^/dev/null | |
bind -M insert \cs '__ssh_peco_ctrl_s' | |
bind -M insert \cb '__git_branch_peco_ctrl_b' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment