04c5cf9974
[Bugfix] Fix completion menu |
||
---|---|---|
.github | ||
debug | ||
docker | ||
functions | ||
generator | ||
segments | ||
shunit2@768978563f | ||
test | ||
test-bsd-vm | ||
test-vm | ||
test-vm-providers | ||
zsh-async@98d32afcce | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
DEVELOPERS_GUIDE.md | ||
feature_intro.png | ||
feature_intro.svg | ||
INSTALL.md | ||
LICENSE | ||
p9k_flowchart.png | ||
p9k_flowchart.svg | ||
powerlevel9k.zsh-theme | ||
prompt_powerlevel9k_setup | ||
README.md | ||
STYLEGUIDE.md | ||
STYLIZING.md | ||
test-in-docker | ||
TESTS.md |
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:
- Give users a great out-of-the-box configuration with no additional configuration required.
- Make customization easy for users who do want to tweak their prompt.
- 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.
- 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
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.
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.
- General Stylizing Options
- Per Segment Stylizing
- Usable Colors
- Glue Segments Together
- 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 nameip
- 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 usernamevi_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 thisgit
repository (if you are in one).vcs
- Information about thisgit
orhg
repository (if you are in one).
Language Segments:
- GoLang Segments:
go_version
- Show the current GO version.
- 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:
php_version
- Show the current PHP version.laravel_version
- Show the current Laravel version.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.
- Python Segments:
virtualenv
- Your Python VirtualEnv.anaconda
- Your active Anaconda environment.pyenv
- Your active python version as reported by the first word ofpyenv 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 usingchruby
(if one is active).rbenv
- Ruby environment information usingrbenv
(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:
rust_version
- Display the current rust version and logo.
- Swift Segments:
swift_version
- Show the version number of the installed Swift.
- Java Segments:
java_version
- Show the current Java version.
- 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 yourkubectl
configuration.dropbox
- Indicates Dropbox directory and syncing status usingdropbox-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 systemdnewline
- 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