-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
90 lines (74 loc) · 2.36 KB
/
.bashrc
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
bind 'set show-all-if-ambiguous on'
bind 'set menu-complete-display-prefix on'
bind 'TAB: menu-complete'
bind 'set colored-completion-prefix on'
bind 'set colored-stats on'
shopt -s cdspell
shopt -s nocaseglob
shopt -s checkwinsize
shopt -s no_empty_cmd_completion
shopt -s autocd
shopt -s globstar
set -o vi
# Setup brew
eval "$(/opt/homebrew/bin/brew shellenv)"
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_PREFIX=$(/opt/homebrew/bin/brew --prefix)
# Setup atuin
[ -f $HOMEBREW_PREFIX/etc/profile.d/bash-preexec.sh ] && source "$HOMEBREW_PREFIX/etc/profile.d/bash-preexec.sh"
eval "$(atuin init bash --disable-up-arrow)"
eval "$(fnm env)"
export EDITOR="nvim"
export GH_PAGER=""
export BUN_INSTALL="$HOME/.bun"
export LDFLAGS="-L/opt/homebrew/lib"
export CPPFLAGS="-I/opt/homebrew/include"
export CLFAGS="-Wall -Wextra -Wdouble-promotion -Wshadow -Wvla -fsanitize=address -fsanitize=undefined -pedantic -std=c11"
[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"
[ -f "$HOMEBREW_PREFIX/etc/profile.d/bash_completion.sh" ] && source "$HOMEBREW_PREFIX/etc/profile.d/bash_completion.sh"
for COMPLETION in "${HOMEBREW_PREFIX}/etc/bash_completion.d/"*; do
[ -f "$COMPLETION" ] && source "${COMPLETION}"
done
[ -f "$HOME/.local/share/bash-completion/completions/deno.bash" ] && source "$HOME/.local/share/bash-completion/completions/deno.bash"
[ -f "$HOME/.deno/env" ] && source "$HOME/.deno/env"
PATH="$HOMEBREW_PREFIX/opt/grep/libexec/gnubin:$PATH"
PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
PATH="/opt/homebrew/opt/util-linux/bin:$PATH"
PATH="/opt/homebrew/opt/util-linux/sbin:$PATH"
PATH="$HOME/.local/bin:$PATH"
PATH="$HOME/go/bin:$PATH"
PATH="$BUN_INSTALL/bin:$PATH"
MANPATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnuman:$MANPATH"
alias vi="nvim"
function red() {
local t=$1
printf '\e[31m%s\e[0m' "$t"
}
function cyan() {
local t=$1
printf '\e[36m%s\e[0m' "$t"
}
function ps1_branch() {
local branch=$(git branch --show-current 2>/dev/null)
if [[ -z "$branch" ]]; then
printf ""
else
printf " (%s)" "$branch"
fi
}
function ps1_prompt() {
local exit_code=$1
if [[ "$exit_code" == "0" ]]; then
printf '$'
else
red '$'
fi
}
function ps1_folder() {
cyan "$(basename "$PWD")"
}
function ps1_full_prompt() {
local exit_code=$?
tr -s ' ' <<< "$(ps1_folder) $(ps1_branch) $(ps1_prompt "$exit_code") "
}
export PS1='$(ps1_full_prompt)'