Moved the setTermTitle function call out of the prompt line and into the precmd hook. This shortens the non-visible length of the prompt line and also makes the functionality clearer
36 lines
1.0 KiB
Bash
Executable File
36 lines
1.0 KiB
Bash
Executable File
####################
|
|
# Sherlocks Prompt #
|
|
####################
|
|
|
|
setopt prompt_subst ## Enable prompt Substitution
|
|
|
|
## Load vcs_info module
|
|
autoload -Uz vcs_info
|
|
|
|
## Enable git tracking
|
|
zstyle ':vcs_info:*' enable git
|
|
|
|
## Set icons for Staged and Unstaged Changes
|
|
zstyle ':vcs_info:git*' stagedstr "%{%F{green%}%} %{%f%}"
|
|
zstyle ':vcs_info:git*' unstagedstr "%{%F{red%}%} %{%f%}"
|
|
|
|
## Enable check for changes (CPU-intensive)
|
|
## DISABLE THIS ON LOW POWER SYSTEMS
|
|
zstyle ':vcs_info:git*' check-for-changes true
|
|
|
|
## Set format for Repo Information
|
|
zstyle ':vcs_info:git*' formats "-(%{%F{203}%} %{%f%}%s:%{%F{2}%}שׂ %{%f%}%b %u%c)"
|
|
zstyle ':vcs_info:git*' actionformats "-(%{%F{203}%} %{%f%}%s:%{%F{2}%}שׂ %{%f%}%b %u%c)(%a)"
|
|
|
|
## set precmd to get vcs_info
|
|
## precmd runs before every prompt
|
|
precmd() {
|
|
vcs_info
|
|
setTermTitle "($(whoami)@$(hostname) $(pwd))"
|
|
}
|
|
|
|
PROMPT="╭╼(%{%F{81}%}%n%{%F{245}%}@%{%F{206}%}%m %{%F{245}%}%2~%{%F{259}%})─(%(?.😎.😞 %?))"$'\n'"╰┤"
|
|
export RPROMPT='${vcs_info_msg_0_}'
|
|
|
|
# vim: set ft=zsh:
|