-
-
Save ergoz/8a1ad06b05bf5925818874ac7c079710 to your computer and use it in GitHub Desktop.
fzf-ssh integration for zsh
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-fzf () { | |
local selected_host=$(grep "Host " ~/.ssh/config | cut -b 6- | fzf --query "$LBUFFER") | |
if [ -n "$selected_host" ]; then | |
BUFFER="ssh ${selected_host}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} | |
zle -N ssh-fzf | |
bindkey '^\' ssh-fzf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment