-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprivate_dot_bash_env
More file actions
59 lines (49 loc) · 2 KB
/
private_dot_bash_env
File metadata and controls
59 lines (49 loc) · 2 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
# Bash environment configuration
# This file is managed by chezmoi
# Sourced by .bashrc for shell initialization
# === SSH Agent Setup (using pixi openssh) ===
# Use a fixed socket path so all terminals share the same agent
export SSH_AUTH_SOCK="$HOME/.ssh/agent.sock"
if ! ssh-add -l &>/dev/null; then
# Agent not running or socket stale - start fresh
rm -f "$SSH_AUTH_SOCK"
ssh-agent -a "$SSH_AUTH_SOCK" >/dev/null 2>&1
# Auto-add default key if it exists
for key in id_ed25519 id_rsa; do
[ -f "$HOME/.ssh/$key" ] && ssh-add "$HOME/.ssh/$key" 2>/dev/null && break
done
fi
# === Pixi Setup ===
export PATH="$HOME/.pixi/bin:$PATH"
if command -v pixi &> /dev/null; then
eval "$(pixi completion --shell bash)"
fi
# === Local bin ===
export PATH="$HOME/.local/bin:$PATH"
# === FZF Setup ===
# FZF keybindings (Ctrl+R for history, Ctrl+T for files, Alt+C for cd)
if [ -f "$HOME/.pixi/envs/fzf/share/fzf/shell/key-bindings.bash" ]; then
source "$HOME/.pixi/envs/fzf/share/fzf/shell/key-bindings.bash"
fi
# FZF completion (trigger with ** and tab)
if [ -f "$HOME/.pixi/envs/fzf/share/fzf/shell/completion.bash" ]; then
source "$HOME/.pixi/envs/fzf/share/fzf/shell/completion.bash"
fi
# FZF default options
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
# Use fd instead of find if available (faster, respects .gitignore)
if command -v fd &> /dev/null; then
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'
fi
# === Zoxide Setup ===
if command -v zoxide &> /dev/null; then
eval "$(zoxide init bash)"
fi
# === Forgit Setup ===
if [ -f "$HOME/.pixi/envs/forgit/share/forgit/forgit.plugin.sh" ]; then
source "$HOME/.pixi/envs/forgit/share/forgit/forgit.plugin.sh"
# Fix: plugin expects git-forgit in share/forgit/bin/ but pixi installs it in envs/forgit/bin/
export FORGIT="$HOME/.pixi/envs/forgit/bin/git-forgit"
fi