aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-09-05 19:03:06 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-09-05 19:03:06 +0300
commit26a41f14b820f407eb314fdc5489a9b01379eaf8 (patch)
tree381b79736125ee7553109086d3a88bc904b11518 /powerlevel9k.zsh-theme
parent6e4d24f50da4bacdaa56afb89b16472d6521697f (diff)
Added a segment that shows the PHP version.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme10
1 files changed, 10 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 974273e7..5d29f612 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -556,6 +556,16 @@ prompt_os_icon() {
$1_prompt_segment "$0" "008" "255" "$OS_ICON"
}
+# print PHP version number
+prompt_php_version() {
+ local php_version
+ php_version=$(php -v 2>&1 | grep -oe "^PHP\s*[0-9.]*")
+
+ if [[ -n "$php_version" ]]; then
+ $1_prompt_segment "$0" "013" "255" "$php_version"
+ fi
+}
+
# rbenv information
prompt_rbenv() {
if [[ -n "$RBENV_VERSION" ]]; then