From a5ed29fa9989bb5c3e4228f8c37be771f41f1a7f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 17 Jun 2020 21:17:41 -0700 Subject: Add my old ZSH prompt --- zsh/zshrc.org | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'zsh') diff --git a/zsh/zshrc.org b/zsh/zshrc.org index 9b2eda8..141b780 100644 --- a/zsh/zshrc.org +++ b/zsh/zshrc.org @@ -160,3 +160,40 @@ Autoload any ZSH function from =$HOME/.zsh/functions=. screen when less is closed (=-X=). Handles ANSI colors (=-R=). Stops long lines from wraping (=-S=). And makes searches case-insensitive (=-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 -- cgit v1.2.3-54-g00ecf