Skip to content

Commit fbd2f30

Browse files
committed
Handle linuxbrew in zsh config
1 parent bb0e0f0 commit fbd2f30

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

home/dot_zshrc.tmpl

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,17 @@ source {{ joinPath .chezmoi.sourceDir "lib" "common" "functions.sh" | quote }}
2525
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
2626
# COMPLETION_WAITING_DOTS="true"
2727

28+
{{ if $.gui -}}
29+
LOCAL_EDITOR='code --wait'
30+
{{ else -}}
31+
LOCAL_EDITOR='vim'
32+
{{ end -}}
33+
2834
# Preferred editor for local and remote sessions
2935
if [[ -n $SSH_CONNECTION ]]; then
3036
export EDITOR='vim'
3137
else
32-
export EDITOR='code --wait'
38+
export EDITOR="$LOCAL_EDITOR"
3339
fi
3440

3541
export GIT_EDITOR="$EDITOR"
@@ -70,6 +76,7 @@ brew_add_formula_bin() {
7076
fi
7177
}
7278

79+
{{ if eq $.chezmoi.os "darwin" -}}
7380
# Apple Silicon default brew path
7481
mbrew_bin="/opt/homebrew/bin/brew"
7582

@@ -109,11 +116,18 @@ add_ibrew
109116
{{ end -}}
110117

111118
unset ibrew_bin mbrew_bin ibrew_default_bin mbrew_default_bin
119+
{{ else if $.brewPrefix -}}
120+
eval "$({{ joinPath $.brewPrefix "bin" "brew" | quote }} shellenv zsh)"
121+
{{ end -}}
112122

123+
{{ if $.brewPrefix -}}
113124
source "$HOMEBREW_PREFIX/share/antigen/antigen.zsh"
114-
antigen use oh-my-zsh
115-
antigen theme agnoster
116-
antigen apply
125+
{{ end -}}
126+
if has_cmd antigen; then
127+
antigen use oh-my-zsh
128+
antigen theme agnoster
129+
antigen apply
130+
fi
117131

118132
zstyle ':omz:update' mode auto # update automatically without asking
119133

0 commit comments

Comments
 (0)