From 4020b25a431c26171cc46673a247311fd993215f Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Sun, 29 Mar 2015 11:08:01 -0700 Subject: [PATCH] Enabling `rbenv` by default. Improving the README. --- README.md | 62 ++++++++++++++++++++++++++++-------------- powerlevel9k.zsh-theme | 2 +- 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 26a1b766..fd89cc81 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is a theme for [Oh-My-Zsh](https://github.com/robbyrussell/oh-my-zsh). This theme uses [Powerline Fonts](https://github.com/Lokaltog/powerline-fonts), thus -giving you the most epic terminal styling in the universe (as of 2015 C.E.). +giving you the most epic terminal styling in the universe. Look like a bad-ass. Impress everyone in 'Screenshot Your Desktop' threads. Use powerlevel9k. @@ -11,9 +11,7 @@ information. ### Features -* Mercurial support is now in development Check out the `mercurial_support` branch! - -* Shows lots of information about Git repositories, including: +* Shows lots of information about Git and Hg repositories, including: * branch / tag name * current action status (rebasing, merging, etc.,) * being behind / ahead of your remote @@ -41,32 +39,56 @@ First, you need to install Powerline Fonts. You can find the [installation instructions here](https://powerline.readthedocs.org/en/latest/installation/linux.html#fonts-installation). You can also find the raw font files [in this Github -repository](https://github.com/powerline/fonts). +repository](https://github.com/powerline/fonts) if you want to manually install +them for your OS. -To install this theme, drop the `.zsh-theme` file into your `.oh-my-zsh/custom/themes` -directory: +To install this theme, clone this repository, and then copy or symlink the theme +file into your OMZ's `custom` directory. Note that you cannot simply clone the +repository into `custom/themes`, because OMZ does not traverse sub-directories +in `themes`. - $ cd ~/.oh-my-zsh/custom/themes - $ git clone https://github.com/bhilburn/powerlevel9k.git powerlevel9k + $ cd + $ git clone https://github.com/bhilburn/powerlevel9k.git powerlevel9k.git + $ cd ~/.oh-my-zsh/custom + $ mkdir themes # if it doesn't already exist + $ cd themes + $ ln -s /powerlevel9k.git/powerlevel9k.zsh-theme powerlevel9k.zsh-theme -You then need to select it in your `~/.zshrc`: +You then need to select this theme in your `~/.zshrc`: - ZSH_THEME="powerlevel9k/powerlevel9k" - -If you do not want to display the `user@host` string, you should also put this -in your `~/.zshrc`: - - export DEFAULT_USER= + ZSH_THEME="powerlevel9k" ### Customization -You can choose which segments are shown on each side. Just add the following variables to -your `~/.zshrc`. The below also shows the default settings if you don't define -your own. +You can choose which segments are shown on each side. The segments that are +currently available are: - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir git) +* **context** - Your username and host. +* **dir** - Your current working directory. +* **vcs** - Information about this `git` or `hg` repository (if you are in one). +* **rbenv** - Ruby environment information (if one is active). +* **status** - The return code of the previous command, and status of background jobs. +* **history** - The command number for the current line. +* **time** - System time. + +To specify which segments you want, just add the following variables to your +`~/.zshrc`. If you don't customize this, the below configuration is the default: + + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time) +#### Conditional 'context' + +The `context` segment (user@host string) is conditional. This lets you enable it, but only display +it if you are not your normal user or on a remote host (basically, only print it +when it likely you need it). + +To use this feature, make sure the `context` segment is enabled in your prompt +elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`: + + export DEFAULT_USER= + + ### Bugs / Contact If you have any requests or bug reports, please use the tracker in this Github diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 76ac31de..83d55e8f 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -259,7 +259,7 @@ prompt_rbenv() { # Main prompt build_left_prompt() { if (( ${#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS} == 0 )); then - POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs) + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) fi for element in $POWERLEVEL9K_LEFT_PROMPT_ELEMENTS; do