[zsh] Cooler prompt with two directories

I like it that I have a bit more context, while still not being
overwhelmed
This commit is contained in:
M1dgard 2018-08-20 22:37:45 +02:00
parent ecf63e9190
commit 084f6a9c42
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -1,6 +1,14 @@
# Comment #!/bin/false
PROMPT='%{$fg[yellow]%}%c$(git_prompt_info)$(git_prompt_status) %{$reset_color%} ' function my_pwd {
# ~ for home; keep only the last two directories
echo $(echo "$PWD" | sed -r '
s,^'"$HOME"',~,
s|^.+/([^/]*/[^/]*)$|\1|
:end')
}
PROMPT='%{$fg[yellow]%}$(my_pwd)$(git_prompt_info)$(git_prompt_status) %{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}  " ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}  "
ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX=""
@ -12,3 +20,6 @@ ZSH_THEME_GIT_PROMPT_DELETED=" %{$fg[red]%}✗"
ZSH_THEME_GIT_PROMPT_RENAMED=" %{$fg[blue]%}➦" ZSH_THEME_GIT_PROMPT_RENAMED=" %{$fg[blue]%}➦"
ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$fg[magenta]%}✂" ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$fg[magenta]%}✂"
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$fg[grey]%}✱" ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$fg[grey]%}✱"
# vim: set ft=zsh noet :