-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_profile
More file actions
85 lines (69 loc) · 2.36 KB
/
.bash_profile
File metadata and controls
85 lines (69 loc) · 2.36 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
#!/bin/bash
# -------------- History Configuration --------------
export HISTCONTROL=erasedups
export HISTSIZE=10000
export HISTFILESIZE=20000
export HISTIGNORE="ls:ll:cd:pwd:exit:clear:history"
# -------------- Path Configuration --------------
# Function to add directory to PATH if it exists
pathadd() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
PATH="$1:$PATH"
fi
}
# Add paths in order of priority (highest priority first)
pathadd "$HOME/.local/bin"
pathadd "$HOME/.cabal/bin"
pathadd "$HOME/.ghcup/bin"
pathadd "$HOME/.deno/bin"
pathadd "$HOME/.cargo/bin"
pathadd "/opt/homebrew/opt/ruby/bin"
pathadd "/opt/homebrew/opt/llvm/bin"
pathadd "/usr/local/sbin"
pathadd "$HOME/Library/Python/3.9/bin"
pathadd "/usr/textbin"
pathadd "/opt/homebrew/opt/llvm@16/bin"
pathadd "$HOME/.elan/bin"
# -------------- Development Tool Configuration --------------
# Cargo configuration
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
# Docker for M1 configuration
export DOCKER_BUILDKIT=0
export COMPOSE_DOCKER_CLI_BUILD=0
export DOCKER_DEFAULT_PLATFORM=linux/amd64
# GHCI configuration
export ghci="TERM=dumb ghci"
# Java configuration
if [ -f /usr/libexec/java_home ]; then
JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
export JAVA_HOME
fi
# Homebrew configuration
export HOMEBREW_NO_INSTALL_CLEANUP=1
# -------------- OS-Specific Configuration --------------
if [ "$(uname)" == "Darwin" ]; then
# Silence bash deprecation warning on macOS
export BASH_SILENCE_DEPRECATION_WARNING=1
# Clean .DS_Store files on every login as preferred
(find "$HOME" -name ".DS_Store" -delete &>/dev/null &)
fi
# -------------- External Tool Initialization --------------
# Source bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
# shellcheck source=./.bashrc
source "$HOME/.bashrc"
fi
if [ -r "$HOME/.opam/opam-init/init.sh" ]; then
. "$HOME/.opam/opam-init/init.sh" >/dev/null 2>/dev/null
fi
# Initialize shell enhancements
[ -x /opt/homebrew/bin/brew ] && eval "$(/opt/homebrew/bin/brew shellenv)"
[ -x "$(command -v starship)" ] && eval "$(starship init bash)"
[ -x "$(command -v atuin)" ] && eval "$(atuin init bash)"
# Source cargo environment if it exists
if [ -f "$HOME/.cargo/env" ]; then
. "$HOME/.cargo/env"
fi
# List directory contents when opening a new terminal (personal preference)
ls -l
complete -C /opt/homebrew/bin/terraform terraform