|
|
||
|---|---|---|
| .. | ||
| README.md | ||
| powerline-plain.base.bash | ||
| powerline-plain.theme.bash | ||
README.md
Powerline Theme
A colorful theme, where shows a lot information about your shell session.
Provided Information
- Current path
- Current username and hostname
- Current time
- Current shell level
- Current dirstack level (
pushd/popd) - Current history number
- Current command number
- An indicator when connected by SSH
- An indicator when
sudohas the credentials cached (see thesudomanpage for more info about this) - An indicator when the current shell is inside the Vim editor
- Battery charging status (depends on the [../../plugins/available/battery.plugin.bash](battery plugin))
- SCM Repository status (e.g. Git, SVN)
- The current Kubernetes environment
- The current Python environment (Virtualenv, venv, and Conda are supported) in use
- The current Ruby environment (rvm and rbenv are supported) in use
- Last command exit code (only shown when the exit code is greater than 0)
Configuration
This theme is pretty configurable, all the configuration is done by setting environment variables.
User Information
By default, the username and hostname are shown, but you can change this behavior by setting the value of the following variable:
POWERLINE_PROMPT_USER_INFO_MODE="sudo"
For now, the only supported value is sudo, which hides the username and hostname, and shows an indicator when sudo has the credentials cached. Other values have no effect at this time.
Clock Format
You can change the format using the following variable:
THEME_CLOCK_FORMAT="%H:%M:%S"
The time/date is printed by the date command, so refer to its man page to change the format.
Segment Order
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
aws_profile- Show the current value of theAWS_PROFILEenvironment variablebattery- Battery information (you'll need to enable thebatteryplugin)clock- Current time inHH:MM:SSformatcwd- Current working directory including full folder hierarchy (c.f.wd)hostname- Host name of machinein_toolbox- Show identifier if running inside a toolboxin_vim- Show identifier if running in:terminalfrom vimk8s_context- Show current kubernetes contextlast_status- Exit status of last run commandpython_venv- Python virtual environment information (virtualenv,venvandcondasupported)ruby- Current ruby version if usingrvmnode- Current node version (onlynvmis supported)scm- Version control information,gitterraform- Current terraform workspaceuser_info- Current userwd- Working directory, likecwdbut doesn't show the full folder hierarchy, only the directory you're currently in.shlvl- Show the current shell level (based onSHLVLenvironment variable), but only if you are not in root shelldirstack- Show the current dirstack level (based onDIRSTACKenvironment variable), but only if the stack is not emptyhistory_number- Show current history numbercommand_number- Show current command number
A variable can be defined to set the order of the prompt segments:
POWERLINE_PROMPT="user_info scm python_venv ruby cwd"
The example values above are the current default values, but if you want to remove anything from the prompt, simply remove the "string" that represents the segment from the variable.
Compact Settings
You can configure various aspects of the prompt to use less whitespace. Supported variables are:
| Variable | Description |
|---|---|
| POWERLINE_COMPACT_BEFORE_SEPARATOR | Removes the leading space before each separator |
| POWERLINE_COMPACT_AFTER_SEPARATOR | Removes the trailing space after each separator |
| POWERLINE_COMPACT_BEFOR_FIRST_SEGMENT | Removes the leading space on the first segment |
| POWERLINE_COMPACT_AFTER_LAST_SEGMENT | Removes the trailing space on the last segment |
| POWERLINE_COMPACT_PROMPT | Removes the space after the prompt character |
| POWERLINE_COMPACT | Enable all Compact settings (you can still override individual settings) |
| POWERLINE_PROMPT_AFTER | Adds characters after the prompt |
The default value for all settings is 0 (disabled). Use 1 to enable.