Skip to content

Instantly share code, notes, and snippets.

@gaving
Created November 10, 2014 13:22
Show Gist options
  • Save gaving/9567044415fc2ca692e3 to your computer and use it in GitHub Desktop.
Save gaving/9567044415fc2ca692e3 to your computer and use it in GitHub Desktop.
switch-site() {
if [[ $HOST == *gon* ]] then
SWITCH=${HOST/gon/gye}
else
SWITCH=${HOST/gye/gon}
fi
LBUFFER="ssh $SWITCH"
zle accept-line
}
zle -N switch-site
bindkey "^XS" switch-site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment