summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-09-06 01:02:03 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-09-06 01:02:03 +0300
commita3b61e92fb8188b03b851183eaab2ef8688d81ec (patch)
tree8d771f25084dcd4ca5a2eaaade385febc3aa0a0b
parent3693a3bfa71be170bfbac6a1ff362f89a7972430 (diff)
parent65c44d6141d493b5392be5d076d79f8ddf4c143d (diff)
Merge branch 'next' of github.com:bhilburn/powerlevel9k into next
-rw-r--r--README.md1
-rw-r--r--powerlevel9k.zsh-theme10
2 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index b5a02dd0..56f51e29 100644
--- a/README.md
+++ b/README.md
@@ -239,6 +239,7 @@ currently available are:
* **load** - Your machines 5 minute load average and free RAM.
* **node_version** - Show the version number of the installed Node.js.
* **os_icon** - Display a nice little icon, depending on your operating system.
+* **php_version** - Show the current PHP version.
* **rbenv** - Ruby environment information (if one is active).
* **rspec_stats** - Show a ratio of test classes vs code classes for RSpec.
* **status** - The return code of the previous command, and status of background jobs.
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index ef6d487d..b24e8abb 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -680,6 +680,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