Add my old ZSH prompt

This commit is contained in:
Tom Willemse 2020-06-17 21:17:41 -07:00
parent c2cdc9cd99
commit a5ed29fa99

View file

@ -160,3 +160,40 @@ Autoload any ZSH function from =$HOME/.zsh/functions=.
screen when less is closed (=-X=). Handles ANSI colors (=-R=). Stops screen when less is closed (=-X=). Handles ANSI colors (=-R=). Stops
long lines from wraping (=-S=). And makes searches case-insensitive long lines from wraping (=-S=). And makes searches case-insensitive
(=-i=). (=-i=).
* Prompt
First off, do some setup. Allow the use of functions inside the prompt,
initialize colors and load the ~add-zsh-hook~ function.
#+begin_src sh
setopt PROMPT_SUBST
autoload -U colors
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
colors
#+end_src
Setup VCS info.
#+begin_src sh
add-zsh-hook precmd vcs_info
zstyle ':vcs_info:*' actionformats '%u%c%B%F{1}%a%f%%b %F{3}%s%f:%F{5}%r%f:%F{4}%b%f'
zstyle ':vcs_info:*' enable bzr git hg svn
zstyle ':vcs_info:*' formats '%u%c%F{3}%s%f:%F{5}%r%f:%F{4}%b%f'
zstyle ':vcs_info:*' nvcsformats ''
zstyle ':vcs_info:bzr:*' branchformat '%b'
zstyle ':vcs_info:git:*' check-for-changes 1
zstyle ':vcs_info:*' stagedstr '%F{2}Δ%f'
zstyle ':vcs_info:*' unstagedstr '%F{1}Δ%f'
#+end_src
Set the actual prompts.
#+begin_src sh
PROMPT='%T %2~ %B%(?.%F{2}.%F{1})→%b '
RPROMPT='${vcs_info_msg_0_}'
#+end_src