Make dir levels shown in the prompt configurable

Until now the prompt only shows the last three levels of the prompt,
however I'd personally prefer to have some more levels (i.e. five).

I figured that it's not worth debating about how many levels make sense,
instead it's now configurable in `~/.zshrc`, the current default will be
kept.

This can be achieved by adding the following line to `~/.zshrc` *before*
loading this theme:

```
export LAMBDA_MOD_N_DIR_LEVELS=5
```
This commit is contained in:
Maximilian Bosch
2019-04-12 22:38:20 +02:00
parent 61c373c8aa
commit 87e7cd7971
2 changed files with 13 additions and 1 deletions

View File

@@ -7,3 +7,15 @@ A ZSH theme optimized for people who use:
---
![Screenshot](https://raw.githubusercontent.com/halfo/lambda-mod-zsh-theme/master/screenshot.png)
## Configuring the amount of dir levels
By default only the last three directories are shown in the prompt. The amount of
levels can be configured by setting `LAMBDA_MOD_N_DIR_LEVELS` before loading the prompt:
``` zsh
# ~/.zshrc
export LAMBDA_MOD_N_DIR_LEVELS=10
# load `lambda-mod` and `oh-my-zsh`
```

View File

@@ -30,7 +30,7 @@ function get_right_prompt() {
PROMPT=$'\n'$LAMBDA'\
%{$fg_bold[$USERCOLOR]%}%n\
%{$fg_no_bold[magenta]%}[%3~]\
%{$fg_no_bold[magenta]%}[%'${LAMBDA_MOD_N_DIR_LEVELS:-3}'~]\
$(check_git_prompt_info)\
%{$reset_color%}'