Repository navigation
Expand file tree
/
Copy pathdot_bash_env.tmpl
More file actions
52 lines (47 loc) · 1.72 KB
/
Copy pathdot_bash_env.tmpl
File metadata and controls
52 lines (47 loc) · 1.72 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# shellcheck disable=SC1054,SC1083,SC1009,SC1073,SC1065,SC1064,SC1072 # Contains Go template syntax
# ~/.bash_env - single source of truth for PATH and environment.
# Sourced by ~/.profile (login shells) and ~/.bashrc (interactive shells,
# and sshd-spawned one-shot `ssh host cmd` -- bash routes those through
# ~/.bashrc, so the source line there sits above the interactive guard).
# Keep POSIX-sh compatible, idempotent, and silent (no output).
# Idempotence guard: ~/.profile and ~/.bashrc both source this file, so a login
# interactive shell (every tmux window) would otherwise run all of it twice,
# including ~/.local.bash_env and its brew lookups.
[ -n "${__BASH_ENV_LOADED:-}" ] && return
__BASH_ENV_LOADED=1
_prepend_path() {
case ":${PATH}:" in
*:"$1":*) ;;
*) [ -d "$1" ] && PATH="$1:${PATH}" ;;
esac
}
_prepend_path "/usr/local/go/bin"
_prepend_path "${HOME}/go/bin"
_prepend_path "${HOME}/bin"
_prepend_path "${HOME}/.local/bin"
unset -f _prepend_path
export PATH
# uv-managed PATH additions
# shellcheck disable=SC1090,SC1091
[ -f "${HOME}/.local/bin/env" ] && . "${HOME}/.local/bin/env"
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LESSCHARSET='UTF-8'
export LESS='-FeX2Rgmwz-2'
export PAGER=less
{{ with (index . "user") }}{{ with (index . "tz") }}export TZ='{{ . }}'
{{ end }}{{ end }}
export EDITOR=vi VISUAL=vi
command -v vim >/dev/null 2>&1 && {
EDITOR=vim
VISUAL=vim
}
command -v nvim >/dev/null 2>&1 && {
EDITOR=nvim
VISUAL=nvim
}
export EDITOR VISUAL
# machine-local env overrides (not chezmoi-managed; keep at mode 0600 -- it may
# hold secrets). Sourced last so it can override anything above.
# shellcheck disable=SC1090,SC1091
[ -f "${HOME}/.local.bash_env" ] && . "${HOME}/.local.bash_env"