Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
Go to file
Dominik Ritter 04c5cf9974
Merge pull request #1335 from dritter/fix-completion-menu
[Bugfix] Fix completion menu
2019-09-23 13:38:55 +02:00
.github Merge remote-tracking branch 'ben/master' into merge_067 2019-03-12 23:16:11 +01:00
debug Merge remote-tracking branch 'ben/master' into merge_067 2019-03-12 23:16:11 +01:00
docker Get rid of absolute versions for Dockerfiles 2018-12-11 01:50:47 +01:00
functions Reactivate test for unset variables 2019-09-03 00:43:12 +02:00
generator Reactivate test for unset variables 2019-09-03 00:43:12 +02:00
segments Merge branch 'next' into fix-completion-menu 2019-09-23 13:33:32 +02:00
shunit2@768978563f Update shunit2 and zsh-async 2019-02-28 17:51:51 +01:00
test Reactivate test for unset variables 2019-09-03 00:43:12 +02:00
test-bsd-vm Install more dependencies in VMs 2017-03-21 01:41:47 +01:00
test-vm Replace tabs with spaces 2018-09-22 21:15:40 +02:00
test-vm-providers Add a hint for the p9k test folder inside the VMs 2017-03-21 02:09:34 +01:00
zsh-async@98d32afcce Update shunit2 and zsh-async 2019-02-28 17:51:51 +01:00
.gitignore adds *.zwc to .gitignore 2019-03-15 21:09:54 +01:00
.gitmodules Load zsh-async via HTTPS 2018-09-24 12:28:11 +02:00
.travis.yml Fix tests on travis 2019-05-12 09:53:10 +02:00
CHANGELOG.md Fix typos 2019-09-03 00:57:42 +02:00
CODE_OF_CONDUCT.md Adding Code of Conduct 2017-07-12 10:33:26 -04:00
DEVELOPERS_GUIDE.md Replaced flowchart 2019-01-12 21:07:39 +04:00
feature_intro.png Add a new info picture 2018-12-21 15:46:09 +01:00
feature_intro.svg Add a new info picture 2018-12-21 15:46:09 +01:00
INSTALL.md impoves READMEs 2019-05-14 00:45:47 +02:00
LICENSE Updating Copyright year 2017-03-10 13:46:58 -05:00
p9k_flowchart.png Update flowchart 2019-01-18 19:42:31 +01:00
p9k_flowchart.svg Update flowchart 2019-01-18 19:42:31 +01:00
powerlevel9k.zsh-theme Remove wrong uses of %{ 2019-08-20 22:19:45 +02:00
prompt_powerlevel9k_setup Fix theme for use with plain "prompt" command 2017-01-29 14:34:32 +01:00
README.md Merge branch 'next' into fix-completion-menu 2019-09-23 13:33:32 +02:00
STYLEGUIDE.md Add our styleguide 2018-12-18 03:41:44 +01:00
STYLIZING.md Fix typos 2019-09-03 00:57:42 +02:00
test-in-docker Stage 2: Update code to use Style Guidelines 2018-09-13 12:56:35 +04:00
TESTS.md Improve test tutorial 2018-10-13 03:03:52 +02:00

Build Status Join the chat at https://gitter.im/bhilburn/powerlevel9k

Powerlevel9k is a theme for ZSH which uses Powerline Fonts. It can be used with vanilla ZSH or ZSH frameworks such as Oh-My-Zsh, Prezto, Antigen, and many others.

Get more out of your terminal. Be a badass. Impress everyone in 'Screenshot Your Desktop' threads. Use powerlevel9k.

You can check out some other users' configurations in our wiki: Show Off Your Config. Bear in mind that the configurations might be for older versions of powerlevel9k and might not work properly with the latest version of powerlevel9k.

There are a number of Powerline ZSH themes available, now. The developers of this theme focus on four primary goals:

  1. Give users a great out-of-the-box configuration with no additional configuration required.
  2. Make customization easy for users who do want to tweak their prompt.
  3. Provide useful segments that you can enable to make your prompt even more effective and helpful. We have prompt segments for everything from unit test coverage to your AWS instance.
  4. Optimize the code for execution speed as much as possible. A snappy terminal is a happy terminal.

Powerlevel9k can be used to create both very useful and beautiful terminal environments.

Table of Contents

  1. Installation
  2. Customization
    1. Customizing Prompt Segments
    2. Stylizing Your Prompt
    3. Available Prompt Segments
    4. Custom Prompt Segments
  3. Troubleshooting

Be sure to also check out the Wiki!

Installation

There are two installation steps to go from a vanilla terminal to a P9K terminal. Once you are done, you can optionally customize your prompt.

Installation Instructions

  1. Install the Powerlevel9k Theme
  2. Install Powerline Fonts

No configuration is necessary post-installation if you like the default settings, but there are plenty of segment customization options available if you are interested.

Prompt Customization

Customizing Prompt Segments

Customizing your prompt is easy! Select the segments you want to have displayed, and then assign them to either the left or right prompt by adding the following variables to your ~/.zshrc. Make sure to do this before you source/load P9K since only the segments you specify will be loaded.

Variable Default Value Description
P9K_LEFT_PROMPT_ELEMENTS (context dir vcs) Segment list for left prompt
P9K_RIGHT_PROMPT_ELEMENTS (status root_indicator background_jobs history time) Segment list for right prompt

The table above shows the default values, so if you wanted to set these variables manually, you would put the following in your ~/.zshrc:

P9K_LEFT_PROMPT_ELEMENTS=(context dir vcs)
P9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator background_jobs history time)

Stylizing Your Prompt

Always set customizations before sourcing/loading P9K! Not every option can be changed at runtime.

Please read the linked sections for details but here is the TL;DR for how to change colors and more per segment with some examples:

# standard customizations
#P9K_<segment>[_<state>]_[BACKGROUND|FOREGROUND|BOLD|ICON[_BOLD|_COLOR]]
# examples
P9K_DATE_BACKGROUND='#fff8e7'      # color background of stateless segment "date"
P9K_CONTEXT_DEFAULT_FOREGROUND=133 # set foreground color for segment "context" state "default"
P9K_DOCKER_MACHINE_BOLD=true       # make stateless segment "docker_machine" bold
P9K_DATE_ICON=time                 # icon for stateless segment "time"
P9K_DIR_HOME_ICON=$'\uF015'        # icon for stateful segment "dir" state "HOME"
P9K_DIR_HOME_ICON_COLOR=red        # color stateful segment icon
P9K_DIR_HOME_ICON_BOLD=true        # make icon bold (only if font supports it)

Please refer to the segment's documentation for segment specific stuff.

  1. General Stylizing Options
  2. Per Segment Stylizing
  3. Usable Colors
  4. Glue Segments Together
  5. Icon Customization

Available Prompt Segments

The segments that are currently available are:

System Status Segments:

  • background_jobs - Indicator for background jobs.
  • battery - Current battery status.
  • context - Your username and host, conditionalized based on $USER and SSH status.
  • date - System date.
  • dir - Your current working directory.
  • dir_writable - Displays a lock icon, if you do not have write permissions on the current folder.
  • disk_usage - Disk usage of your current partition.
  • history - The command number for the current line.
  • host - Your current host name
  • ip - Shows the current IP address.
  • vpn_ip - Shows the current VPN IP address.
  • public_ip - Shows your public IP address.
  • load - Your machine's load averages.
  • os_icon - Display a nice little icon, depending on your operating system.
  • ram - Show free RAM.
  • root_indicator - An indicator if the user has superuser status.
  • status - The return code of the previous command.
  • swap - Prints the current swap size.
  • time - System time.
  • user - Your current username
  • vi_mode- Your prompt's Vi editing mode (NORMAL|INSERT).
  • ssh - Indicates whether or not you are in an SSH session.

Development Environment Segments:

  • gitstatus - Information about this git repository (if you are in one).
  • vcs - Information about this git or hg repository (if you are in one).

Language Segments:

  • GoLang Segments:
  • Javascript / Node.js Segments:
    • node_version - Show the version number of the installed Node.js.
    • nodeenv - nodeenv prompt for displaying node version and environment name.
    • nvm - Show the version of Node that is currently active, if it differs from the version used by NVM
  • PHP Segments:
  • Python Segments:
    • virtualenv - Your Python VirtualEnv.
    • anaconda - Your active Anaconda environment.
    • pyenv - Your active python version as reported by the first word of pyenv version. Note that the segment is not displayed if that word is system i.e. the segment is inactive if you are using system python.
  • Ruby Segments:
    • chruby - Ruby environment information using chruby (if one is active).
    • rbenv - Ruby environment information using rbenv (if one is active).
    • rspec_stats - Show a ratio of test classes vs code classes for RSpec.
    • rvm - Ruby environment information using $GEM_HOME and $MY_RUBY_HOME (if one is active).
  • Rust Segments:
  • Swift Segments:
    • swift_version - Show the version number of the installed Swift.
  • Java Segments:
  • Haskell Segments:
    • stack_project - Show if you are in a Haskell Stack project directory.

Cloud Segments:

  • AWS Segments:
    • aws - The current AWS profile, if active.
    • aws_eb_env - The current Elastic Beanstalk Environment.
  • docker_machine - The current Docker Machine.
  • kubecontext - The current context of your kubectl configuration.
  • dropbox - Indicates Dropbox directory and syncing status using dropbox-cli

Other:

  • custom_* - Create a custom segment to display the output of an arbitrary command.
  • command_execution_time - Display the time the current command took to execute.
  • todo - Shows the number of tasks in your todo.txt tasks file.
  • detect_virt - Virtualization detection with systemd
  • newline - Continues the prompt on a new line.
  • openfoam - Shows the currently sourced OpenFOAM environment.
  • vagrant - Detects if you are in a folder with a running VM.

Custom Prompt Segments

The custom_* segment allows you to turn the output of a custom command into a prompt segment. As an example you could create a custom segment custom_wifi_signal if you wanted to display your WiFi signal strength. You can take a look at how to create a custom segment here.

Disabling / Enabling Powerlevel9k

You can disable P9k and return to a very basic prompt at any time simply by calling:

$ prompt_powerlevel9k_teardown

You can then re-enable it by calling:

$ prompt_powerlevel9k_setup

tl; dr

Want to just get a quick start? Check out the Show Off Your Config portion of the wiki to get going.

The Wiki also has a ton of other useful information!

Contributing

Would you like to contribute? We would love that! Please feel free to open a Pull Request.
For further information please see our code of conduct, developers guide, styleguide and how we write tests.

Changelog

License

Project: MIT

Logo: CC-BY-SA. Source repository: https://github.com/bhilburn/powerlevel9k-logo