Skip to content

Commit

Permalink
Allow configuring nix-shell integration using zstyle (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
andresilva authored Oct 19, 2021
1 parent a45fada commit 74a90b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ prompt_pure_precmd() {
# Nix package manager integration. If used from within 'nix shell' - shell name is shown like so:
# ~/Projects/flake-utils-plus master
# flake-utils-plus ❯
if [[ -n $IN_NIX_SHELL ]]; then
psvar[12]="${name:-nix-shell}"
if zstyle -T ":prompt:pure:environment:nix-shell" show; then
if [[ -n $IN_NIX_SHELL ]]; then
psvar[12]="${name:-nix-shell}"
fi
fi

# Make sure VIM prompt is reset.
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ You can set Pure to only `git fetch` the upstream branch of the current local br

`zstyle :prompt:pure:git:fetch only_upstream yes`

`nix-shell` integration adds the shell name to the prompt when used from within a nix shell. It is enabled by default, you can disable it with:

`zstyle :prompt:pure:environment:nix-shell show no`

## Colors

As explained in ZSH's [manual](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting), color values can be:
Expand Down

0 comments on commit 74a90b7

Please sign in to comment.