@ -87,7 +87,7 @@ The segments that are currently available are:
**System Status Segments:**
**System Status Segments:**
* [`background_jobs`](#background_jobs) - Indicator for background jobs.
* [`background_jobs`](#background_jobs) - Indicator for background jobs.
* [`battery`](#battery) - Current battery status.
* [`battery`](#battery) - Current battery status.
* [`context`](#context) - Your username and host.
* [`context`](#context) - Your username and host, conditionalized based on $USER and SSH status.
* [`dir`](#dir) - Your current working directory.
* [`dir`](#dir) - Your current working directory.
* `dir_writable` - Displays a lock icon, if you do not have write permissions on the current folder.
* `dir_writable` - Displays a lock icon, if you do not have write permissions on the current folder.
* [`disk_usage`](#disk_usage) - Disk usage of your current partition.
* [`disk_usage`](#disk_usage) - Disk usage of your current partition.
@ -102,6 +102,7 @@ The segments that are currently available are:
* `swap` - Prints the current swap size.
* `swap` - Prints the current swap size.
* [`time`](#time) - System time.
* [`time`](#time) - System time.
* [`vi_mode`](#vi_mode)- Your prompt's Vi editing mode (NORMAL|INSERT).
* [`vi_mode`](#vi_mode)- Your prompt's Vi editing mode (NORMAL|INSERT).
* `ssh` - Indicates whether or not you are in an SSH session.
**Development Environment Segments:**
**Development Environment Segments:**
* [`vcs`](#vcs) - Information about this `git` or `hg` repository (if you are in one).
* [`vcs`](#vcs) - Information about this `git` or `hg` repository (if you are in one).
@ -243,24 +244,26 @@ main theme distribution so that everyone can use it!
##### context
##### context
The `context` segment (user@host string) is conditional. This lets you enable
The `context` segment (user@host string) is conditional. By default, it will
it, but only display it if you are not your normal user or on a remote host
only print if you are not your 'normal' user (including if you are root), or if
(basically, only print it when it's likely you need it).
you are SSH'd to a remote host.
To use this feature, make sure the `context` segment is enabled in your prompt
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`:
elements (it is by default), and define a `DEFAULT_USER` in your `~/.zshrc`:
You can set the `POWERLEVEL9K_CONTEXT_HOST_DEPTH` variable to change how the
You can set the `POWERLEVEL9K_CONTEXT_HOST_DEPTH` variable to change how the
hostname is displayed. See (ZSH Manual)[http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Login-information]
hostname is displayed. See (ZSH Manual)[http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Login-information]
for details. Default is set to %m which will show the hostname up to the first ‘.’
for details. The default is set to %m which will show the hostname up to the first ‘.’
You can set it to %{N}m where N is an integer to show that many segments of system
You can set it to %{N}m where N is an integer to show that many segments of system
hostname. Setting N to a negative integer will show that many segments from the
hostname. Setting N to a negative integer will show that many segments from the
end of the hostname.
end of the hostname.
| Variable | Default Value | Description |
| Variable | Default Value | Description |
|----------|---------------|-------------|
|----------|---------------|-------------|
|`DEFAULT_USER`|None|Username to consider a "default context" (you can also use `$USER`)|
|`DEFAULT_USER`|None|Username to consider a "default context".|
|`POWERLEVEL9K_CONTEXT_HOST_DEPTH`|%m|Customizable host depth on prompt|
|`POWERLEVEL9K_CONTEXT_HOST_DEPTH`|%m|Customizable host depth on prompt.|
|`POWERLEVEL9K_ALWAYS_SHOW_CONTEXT`|false|Always show this segment, including $USER and hostname.|
|`POWERLEVEL9K_ALWAYS_SHOW_USER`|false|Always show the username, but conditionalize the hostname.|
##### dir
##### dir
@ -285,9 +288,17 @@ Customizations available are:
| Variable | Default Value | Description |
| Variable | Default Value | Description |
|----------|---------------|-------------|
|----------|---------------|-------------|
|`POWERLEVEL9K_SHORTEN_DIR_LENGTH`|`2`|If your shorten strategy, below, is entire directories, this field determines how many directories to leave at the end. If your shorten strategy is by character count, this field determines how many characters to allow per directory string.|
|`POWERLEVEL9K_SHORTEN_DIR_LENGTH`|`2`|If your shorten strategy, below, is entire directories, this field determines how many directories to leave at the end. If your shorten strategy is by character count, this field determines how many characters to allow per directory string.|
|`POWERLEVEL9K_SHORTEN_STRATEGY`|None|How the directory strings should be truncated. By default, it will truncate whole directories. Other options are `truncate_middle`, which leaves the start and end of the directory strings, and `truncate_from_right`, which cuts starting from the end of the string. You can also use `truncate_with_package_name` to use the `package.json``name` field to abbreviate the directory path.|
|`POWERLEVEL9K_SHORTEN_STRATEGY`|None|How the directory strings should be truncated. See the table below for more informations.|
|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to use in truncated strings. This can be any string you choose, including an empty string if you wish to have no delimiter.|
|`POWERLEVEL9K_SHORTEN_DELIMITER`|`..`|Delimiter to use in truncated strings. This can be any string you choose, including an empty string if you wish to have no delimiter.|
| Strategy Name | Description |
|---------------|-------------|
|Default|Truncate whole directories from left. How many is defined by `POWERLEVEL9K_SHORTEN_DIR_LENGTH`|
|`truncate_middle`|Truncates the middle part of a folder. E.g. you are in a folder named "~/MySuperProjects/AwesomeFiles/BoringOffice", then it will truncated to "~/MyS..cts/Awe..les/BoringOffice", if `POWERLEVEL9K_SHORTEN_DIR_LENGTH=3` is also set (controls the amount of characters to be left).|
|`truncate_from_right`|Just leaves the beginning of a folder name untouched. E.g. your folders will be truncated like so: "/ro../Pr../office". How many characters will be untouched is controlled by `POWERLEVEL9K_SHORTEN_DIR_LENGTH`.|
|`truncate_with_package_name`|Use the `package.json``name` field to abbreviate the directory path.|
|`truncate_with_folder_marker`|Search for a file that is specified by `POWERLEVEL9K_SHORTEN_FOLDER_MARKER` and truncate everything before that (if found, otherwise stop on $HOME and ROOT).|
For example, if you wanted the truncation behavior of the `fish` shell, which
For example, if you wanted the truncation behavior of the `fish` shell, which
truncates `/usr/share/plasma` to `/u/s/plasma`, you would use the following:
truncates `/usr/share/plasma` to `/u/s/plasma`, you would use the following:
```zsh
```zsh
@ -311,9 +322,12 @@ the path shown would be `my-cool-project`. If you navigate to `$HOME/projects/m
If you want to customize the directory separator, you could set:
If you want to customize the directory separator, you could set:
```zsh
```zsh
# You'll need patched awesome-terminal fonts for that example