[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:
parent
ecf63e9190
commit
084f6a9c42
1 changed files with 13 additions and 2 deletions
|
@ -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 :
|
||||||
|
|
Loading…
Reference in a new issue