Last active
January 22, 2019 03:26
-
-
Save shinpei/1086b4583bdb4bbd1572698be5d5cd02 to your computer and use it in GitHub Desktop.
fzf-gcloud
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
# 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