aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-11-02 12:42:01 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-11-02 12:45:38 +0300
commit99e632f97d23d1c3bc1d60c6c7d45be2ad644345 (patch)
treeb82faeaba0e823b9809913c7d62ffd2227467d4f /internal/p10k.zsh
parent2057080ec2849d94e2d07ccec9caab4fe1c00b59 (diff)
add POWERLEVEL9K_<segment>_DISABLED_DIR_PATTERN
This parameter allows you to disable a given prompt segment in any directory that matches the specified pattern. For example, if you have a Git repository in /foo/bar for which you don't want to see Git status in prompt, define the following parameter: POWERLEVEL9K_VCS_DISABLED_DIR_PATTERN='/foo/bar(|/*)' See #300.
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r--internal/p10k.zsh4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 58ce5321..165e1eea 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -3432,6 +3432,8 @@ function _p9k_set_iface() {
function _p9k_build_segment() {
_p9k_segment_name=${_p9k_segment_name%_joined}
+ local disabled=POWERLEVEL9K_${(U)_p9k_segment_name}_DISABLED_DIR_PATTERN
+ [[ $_p9k_pwd == ${(P)~disabled} ]] && return
if [[ $_p9k_segment_name == custom_* ]]; then
_p9k_custom_prompt $_p9k_segment_name[8,-1]
elif (( $+functions[prompt_$_p9k_segment_name] )); then
@@ -3442,6 +3444,8 @@ function _p9k_build_segment() {
function _p9k_build_instant_segment() {
_p9k_segment_name=${_p9k_segment_name%_joined}
+ local disabled=POWERLEVEL9K_${(U)_p9k_segment_name}_DISABLED_DIR_PATTERN
+ [[ $_p9k_pwd == ${(P)~disabled} ]] && return
if (( $+functions[instant_prompt_$_p9k_segment_name] )); then
local -i len=$#_p9k__prompt
_p9k_non_hermetic_expansion=0