-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_bashrc.tmpl
More file actions
174 lines (141 loc) · 7.25 KB
/
dot_bashrc.tmpl
File metadata and controls
174 lines (141 loc) · 7.25 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
{{- if eq .chezmoi.os "linux" -}}
# ~/.bashrc - Bash configuration (Linux/Bazzite)
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Source drop-in configs
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
export EDITOR='nvim'
export VISUAL='nvim'
# Linuxbrew — override system brew.sh which appends; we want brew before /usr/bin
if [[ -d /home/linuxbrew/.linuxbrew ]]; then
PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
export PATH
fi
# Podman as Docker (keep here — system-level, not a dev alias)
command -v podman &>/dev/null && alias docker=podman
# Atuin shell history
if [[ -f "$HOME/.atuin/bin/env" ]]; then
. "$HOME/.atuin/bin/env"
fi
if command -v atuin &>/dev/null; then
eval "$(atuin init bash)"
fi
# mise (runtime manager)
if [[ -x "$HOME/.local/bin/mise" ]]; then
eval "$($HOME/.local/bin/mise activate bash)"
fi
# FZF
export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_CTRL_T_OPTS="--preview 'bat --color=always --line-range=:200 {}'"
export FZF_ALT_C_COMMAND='fd --type d --hidden --exclude .git'
export FZF_ALT_C_OPTS="--preview 'eza --tree --level=2 {}'"
if command -v fzf &>/dev/null; then
eval "$(fzf --bash)"
fi
# Starship prompt
if command -v starship &>/dev/null; then
eval "$(starship init bash)"
fi
# Zoxide (smart cd)
if command -v zoxide &>/dev/null; then
eval "$(zoxide init bash)"
fi
{{- else if eq .chezmoi.os "windows" -}}
# ~/.bashrc - Bash configuration for Git Bash on Windows
# ─────────────────────────────────────────────────────────────────────────────
# PATH
# ─────────────────────────────────────────────────────────────────────────────
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/AppData/Local/Programs/Python/Python314-arm64:$HOME/AppData/Local/Programs/Python/Python314-arm64/Scripts:$PATH"
# ─────────────────────────────────────────────────────────────────────────────
# Environment
# ─────────────────────────────────────────────────────────────────────────────
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export EDITOR="vim"
export VISUAL="$EDITOR"
# ─────────────────────────────────────────────────────────────────────────────
# Greeting (interactive shells only)
# ─────────────────────────────────────────────────────────────────────────────
if [[ $- == *i* ]] && [[ -x "$HOME/.local/bin/greet-bash" ]]; then
"$HOME/.local/bin/greet-bash"
fi
# ─────────────────────────────────────────────────────────────────────────────
# fnm (Fast Node Manager) - ARM64 Native
# ─────────────────────────────────────────────────────────────────────────────
export PATH="$HOME/AppData/Local/Microsoft/WinGet/Links:$PATH"
export PATH="$HOME/AppData/Roaming/fnm:$PATH"
if command -v fnm &> /dev/null; then
eval "$(fnm env --use-on-cd --shell bash --arch arm64)"
else
echo "[warn] fnm not found. Install via: winget install Schniz.fnm"
fi
# ─────────────────────────────────────────────────────────────────────────────
# Atuin (shell history)
# ─────────────────────────────────────────────────────────────────────────────
if command -v atuin &> /dev/null; then
eval "$(atuin init bash)"
fi
# ─────────────────────────────────────────────────────────────────────────────
# Starship Prompt
# ─────────────────────────────────────────────────────────────────────────────
export PATH="/c/Program Files/starship/bin:$PATH"
if command -v starship &> /dev/null; then
eval "$(starship init bash)"
fi
# ─────────────────────────────────────────────────────────────────────────────
# Zoxide (smarter cd)
# ─────────────────────────────────────────────────────────────────────────────
if command -v zoxide &> /dev/null; then
eval "$(zoxide init bash)"
fi
# ─────────────────────────────────────────────────────────────────────────────
# Aliases
# ─────────────────────────────────────────────────────────────────────────────
# Better ls with eza
if command -v eza &> /dev/null; then
alias ls="eza --icons"
alias ll="eza -la --icons"
alias lt="eza --tree --icons"
alias la="eza -a --icons"
fi
# Better cat with bat
if command -v bat &> /dev/null; then
alias cat="bat"
fi
# Git shortcuts
alias gs="git status"
alias ga="git add"
alias gc="git commit -m"
alias gp="git push"
alias gl="git log --oneline --graph --all"
alias gd="git diff"
alias gco="git checkout"
alias gb="git branch"
# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
# Docker
alias d="docker"
alias dc="docker compose"
alias dps="docker ps"
alias dpa="docker ps -a"
alias di="docker images"
{{- end }}