Skip to content

Instantly share code, notes, and snippets.

@shinpei
Last active January 22, 2019 03:26
Show Gist options
  • Save shinpei/1086b4583bdb4bbd1572698be5d5cd02 to your computer and use it in GitHub Desktop.
Save shinpei/1086b4583bdb4bbd1572698be5d5cd02 to your computer and use it in GitHub Desktop.
fzf-gcloud
# fzf gcloud
function fzf-gconf() {
local proj=$(gcloud config configurations list | grep -v NAME | fzf --query "$LBUFFER")
if [ -n "$proj" ]; then
local cnf=$(echo ${proj} | awk '{print $1;}')
BUFFER="gcloud config configurations activate ${cnf}"
zle accept-line
fi
zle reset-prompt
}
zle -N fzf-gconf
bindkey '^V' fzf-gconf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment