diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 93 |
1 files changed, 89 insertions, 4 deletions
@@ -1,7 +1,7 @@ ## powerlevel9k Theme for ZSH Powerlevel9k is a theme for ZSH which uses [Powerline -Fonts](https://github.com/Lokaltog/powerline-fonts). It can be used with vanilla +Fonts](https://github.com/powerline/fonts). It can be used with vanilla ZSH, [Oh-My-Zsh](https://github.com/robbyrussell/oh-my-zsh), or [Prezto](https://github.com/sorin-ionescu/prezto), and can also be installed using [antigen](https://github.com/zsh-users/antigen). @@ -41,6 +41,7 @@ this theme focus on four primary goals: - [The AWS Profile Segment](#the-aws-profile-segment) - [The 'context' Segment](#the-context-segment) - [The 'dir' segment](#the-dir-segment) + - [The 'ip' segment](#the-ip-segment) - [The 'time' segment](#the-time-segment) - [Unit Test Ratios](#unit-test-ratios) - [The 'vcs' Segment](#the-vcs-segment) @@ -49,11 +50,13 @@ this theme focus on four primary goals: - [Double-Lined Prompt](#double-lined-prompt) - [Disable Right Prompt](#disable-right-prompt) - [Light Color Theme](#light-color-theme) + - [Icon Customization](#icon-customization) - [Segment Color Customization](#segment-color-customization) - [Special Segment Colors](#special-segment-colors) - [Troubleshooting](#troubleshooting) - [Gaps Between Segments](#gaps-between-segments) - [Segment Colors are Wrong](#segment-colors-are-wrong) + - [Strange Characters in prompt](#strange-characters-in-prompt) - [Meta](#meta) - [Kudos](#kudos) - [Developing](#developing) @@ -237,14 +240,18 @@ currently available are: * **context** - Your username and host (more info below) * **dir** - Your current working directory. * **history** - The command number for the current line. +* **ip** - Shows the current IP address. +* **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. -* **longstatus** - Same as previous, except this creates a status segment for the *right* prompt. * **symfony2_tests** - Show a ratio of test classes vs code classes for Symfony2. * **symfony2_version** - Show the current Symfony2 version, if you are in a Symfony2-Project dir. * **time** - System time. +* **vi_mode** - Vi editing mode (NORMAL|INSERT). * **virtualenv** - Your Python [VirtualEnv](https://virtualenv.pypa.io/en/latest/). * **vcs** - Information about this `git` or `hg` repository (if you are in one). @@ -252,7 +259,7 @@ 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=(longstatus history time) + POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time) #### The AWS Profile Segment @@ -282,6 +289,27 @@ to a certain length: # Limit to the last two folders POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 +To change the way how the current working directory is truncated, just set: + + # truncate the middle part + POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle" + # truncate from right, leaving the first X characters untouched + POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" + # default behaviour is to truncate whole directories + +In each case you have to specify the length you want to shorten the directory +to. So in some cases `POWERLEVEL9K_SHORTEN_DIR_LENGTH` means characters, in +others whole directories. + +#### The 'ip' segment + +This segment shows you your current internal IP address. It tries to examine +all currently used network interfaces and prints the first address it finds. +In the case that this is not the right IP address you can specify the correct +network interface by setting: + + POWERLEVEL9K_IP_INTERFACE="eth0" + #### The 'time' segment By default the time is show in 'H:M:S' format. If you want to change it, @@ -297,6 +325,13 @@ segment, as well: # Output time, date, and a symbol from the "Awesome Powerline Font" set POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S \uE868 %d.%m.%y}" +#### Showing Status + +Usually we display always the status, and in case a command failed, the return +code of the last executed program. In case you want to display the status only +if something special happend, you can set `POWERLEVEL9K_STATUS_VERBOSE=false` +in your `~/.zshrc`. + #### Unit Test Ratios The `symfony2_tests` and `rspec_tests` segments both show a ratio of "real" @@ -306,6 +341,26 @@ is count your source files and test files, and calculate the ratio between them. Just enough to give you a quick overview about the test situation of the project you are dealing with. +#### VI-Mode Indicator + +This Segment shows the current mode of your ZSH. If you want to use your ZSH in +VI-Mode, you need to configure it separatly in your `~/.zshrc`: + + # VI-Mode + # general activation + bindkey -v + + # set some nice hotkeys + bindkey '^P' up-history + bindkey '^N' down-history + bindkey '^?' backward-delete-char + bindkey '^h' backward-delete-char + bindkey '^w' backward-kill-word + bindkey '^r' history-incremental-search-backward + + # make it more responsive + export KEYTIMEOUT=1 + #### The 'vcs' Segment By default, the `vcs` segment will provide quite a bit of information. If you @@ -387,6 +442,27 @@ Light'](https://github.com/altercation/solarized) users. Check it out: ![](http://bhilburn.org/content/images/2015/03/solarized-light.png) +#### Icon Customization + +Each icon used can be customized too by specifying a variable named like +the icon and prefixed with 'POWERLEVEL9K'. If you want to use another icon +as segment separators, you can easily do that: + + POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=$'\uE0B1' + POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=$'\uE0B3' + +You could get a list of all icons defined in random colors, by adding the +special segment `icons_test` to your prompt: + + POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(icons_test) + +This special prompt does not work on the right side, as it would be too long, +and ZSH hides it automatically. Also have in mind, that the output depends on +your `POWERLEVEL9K_MODE` settings. + +You can change any icon by setting a environment variable. To get a full list +of icons just type `get_icon_names` in your terminal. + #### Segment Color Customization For each segment in your prompt, you can specify a foreground and background @@ -467,12 +543,21 @@ terminal, which should yield `256`. If you see something different, try setting TERM=xterm-256color +#### Strange Characters in prompt + +If your prompt shows strange character like this: + +![](https://cloud.githubusercontent.com/assets/1544760/9156161/e0e584e6-3ed0-11e5-897a-2318a8e32d35.png) + +it is most likely that you set `POWERLEVEL9K_MODE="awesome-patched"`, but +did not install an [awesome-font](https://github.com/gabrielelana/awesome-terminal-fonts). For most other modes, you need a [powerline-patched](https://github.com/powerline/fonts) font. + ### Meta #### Kudos This theme wouldn't have happened without inspiration from the original -[agnoster](https://gist.github.com/agnoster/3712874) Oh-My-ZSH theme. +[agnoster](https://github.com/agnoster/agnoster-zsh-theme) ZSH theme. Before creating this theme, I also tried [jeremyFreeAgent's theme](https://github.com/jeremyFreeAgent/oh-my-zsh-powerline-theme) and |