diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-08-19 17:07:59 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-08-19 17:07:59 +0300 |
commit | 4c12eb7224b053a511a06da0b3efe26f067a4942 (patch) | |
tree | a903a0e640df72bf6292cb47089c75b2a3a0db66 /internal | |
parent | 37c6ea091e0cc64f6741ca874d91db5ad579406f (diff) |
add terraform prompt segment
Diffstat (limited to 'internal')
-rwxr-xr-x | internal/icons.zsh | 5 | ||||
-rwxr-xr-x | internal/p10k.zsh | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/internal/icons.zsh b/internal/icons.zsh index 3693bfb3..52155cab 100755 --- a/internal/icons.zsh +++ b/internal/icons.zsh @@ -109,6 +109,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ ) ;; 'awesome-fontconfig') @@ -207,6 +208,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ ) ;; 'awesome-mapped-fontconfig') @@ -309,6 +311,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ ) ;; 'nerdfont-complete'|'nerdfont-fontconfig') @@ -408,6 +411,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '\ue73f ' # RANGER_ICON '\u2B50' # ⭐ + TERRAFORM_ICON '\U1F6E0\u00A0' # 🛠️ ) ;; *) @@ -506,6 +510,7 @@ function _p9k_init_icons() { JAVA_ICON '\U2615' # ☕︎ LARAVEL_ICON '' RANGER_ICON '\u2B50' # ⭐ + TERRAFORM_ICON 'TF' ) ;; esac diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 7ba7b69d..698a45c6 100755 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -3039,6 +3039,18 @@ function prompt_ranger() { _p9k_prompt_segment $0 $_p9k_color1 yellow RANGER_ICON 0 '' $RANGER_LEVEL } +function prompt_terraform() { + (( $+commands[terraform] )) || return + local ws=default + if [[ -n $TF_WORKSPACE ]]; then + ws=$TF_WORKSPACE + else + local f=${TF_DATA_DIR:-.terraform}/environment + [[ -r $f ]] && _p9k_read_file $f && ws=$_p9k_ret + fi + [[ $ws == default ]] || _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws +} + _p9k_preexec() { if (( $+_p9k_real_zle_rprompt_indent )); then if [[ -n $_p9k_real_zle_rprompt_indent ]]; then |