-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
37 lines (31 loc) · 1.13 KB
/
dot_zshrc.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{{ if eq .chezmoi.os "darwin" -}}
# Use Homebrew
fpath+=("$(/opt/homebrew/bin/brew --prefix)/share/zsh/site-functions")
eval "$(/opt/homebrew/bin/brew shellenv)"
{{- end }}
# Use mise
eval "$(mise activate zsh)"
# Configure Zim modules
zstyle ':zim:zmodule' use 'degit'
zstyle ':zim:termtitle' format '%2~'
{{- /* See .chezmoiexternal.toml for install of ~/.zim/zimfw.zsh */ -}}
# Use Zim to create a livable zsh environment
ZIM_HOME=~/.zim
# Install missing modules and update ${ZIM_HOME}/init.zsh if missing or outdated
if [[ ! ${ZIM_HOME}/init.zsh -nt ${ZDOTDIR:-${HOME}}/.zimrc ]]; then
source ${ZIM_HOME}/zimfw.zsh init -q
fi
source ${ZIM_HOME}/init.zsh
# Set a simple prompt
autoload colors && colors
# Detect git branch for displaying in prompt
git_prompt_info() {
current_branch=$(git symbolic-ref --short HEAD 2> /dev/null)
if [[ -n $current_branch ]]; then
echo " %{$fg_bold[green]%}$current_branch%{$reset_color%}"
fi
}
# Allow exported PS1 variable to override default prompt.
if ! env | grep -q '^PS1='; then
PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}%{$fg_bold[blue]%}%~%{$reset_color%}$(git_prompt_info) %# '
fi