Skip to content

Commit

Permalink
Merge pull request #8 from phux/master
Browse files Browse the repository at this point in the history
Make path formatting configurable
  • Loading branch information
DFurnes authored Feb 27, 2019
2 parents 1163503 + 1679465 commit 00207af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pure.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,14 @@ prompt_pure_preprompt_render() {
fi

local symbol_color="%(?.${PURE_PROMPT_SYMBOL_COLOR:-magenta}.red)"
local path_formatting="${PURE_PROMPT_PATH_FORMATTING:-%c}"

# show virtual env
preprompt+="%(12V.%F{242}%12v%f .)"
# begin with symbol, colored by previous command exit code
preprompt+="%F{$symbol_color}${PURE_PROMPT_SYMBOL:-❯}%f "
# directory, colored by vim status
preprompt+="%B%F{$STATUS_COLOR}%c%f%b"
preprompt+="%B%F{$STATUS_COLOR}$path_formatting%f%b"
# git info
preprompt+="%F{$git_color}${vcs_info_msg_0_}${prompt_pure_git_dirty}%f"
# git pull/push arrows
Expand Down
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Purer supports customization using [Pure's environment variables](https://github

Defines the prompt symbol color. The default value is `magenta`; you can use any [colour name](https://wiki.archlinux.org/index.php/Zsh#Colors) or [numeric colour code](https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg) (see `zshzle(1)` section [Character Highlighting](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting).)


### `PURE_PROMPT_PATH_FORMATTING`

Defines how to display the path. Default value: `%c`. See [Prompt Expansion](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html) for more.

## License

Purer MIT © [David Furnes](http://dfurnes.com) <br/>
Expand Down

0 comments on commit 00207af

Please sign in to comment.