overhaul prompt management; make it easier to add/remove things to {,r}prompt over time

This commit is contained in:
2023-06-30 17:05:18 -07:00
parent ed5afe0300
commit 798ced71aa
5 changed files with 51 additions and 11 deletions

19
modules/base_prompt.zsh Normal file
View File

@@ -0,0 +1,19 @@
# PROMPT="%{$fg_bold[cyan]%}%n%{$fg_bold[white]%}@%{$fg_bold[magenta]%}%m %{$fg_bold[white]%}%~ %# %{$reset_color%}"
# RPROMPT="%(?..%{$fg[red]%}%? )$RPROMPT"
function prompt_userathost () {
print "%{$fg_bold[cyan]%}%n%{$fg_bold[white]%}@%{$fg_bold[magenta]%}%m %{$fg_bold[white]%}%~"
}
prompt_functions+=prompt_userathost
function rprompt_clock () {
print "%{$fg_bold[black]%}%T"
}
function rprompt_retval () {
print "%(?..%{$fg[red]%}%?)"
}
rprompt_functions+=rprompt_clock
rprompt_functions+=rprompt_retval