-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
75 lines (64 loc) · 1.62 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
# skip if not interactive
case $- in
*i*) ;;
*) return ;;
esac
# editor
export EDITOR='code --wait'
# history
export HISTCONTROL=ignoredups
shopt -s histappend
HISTSIZE=100000
HISTFILESIZE=${HISTSIZE}
# colors
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias ls='ls --color=auto'
alias dir='dir --color=auto'
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
# window
shopt -s checkwinsize
# less
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# scripts
[ -d ~/.scripts ] && export PATH="$PATH:$HOME/.scripts"
# prompt
if ! command -v starship &>/dev/null; then
mkdir -p ~/.starship
sh -c "$(curl -fsSL https://starship.rs/install.sh)" - -y -b ~/.starship &>/dev/null
PATH="$PATH:$HOME/.starship"
fi
eval "$(starship init bash)"
if [ ! -f ~/.config/starship.toml ]; then
curl $REPO/.config/starship.toml -o ~/.config/starship.toml &>/dev/null
fi
# profiles (aliases, completion etc.)
declare -a profiles=(
~/.bash_aliases
/opt/homebrew/etc/profile.d/bash_completion.sh
/etc/bash_completion.d/git
/usr/share/bash-completion/completions/git
)
for profile in "${profiles[@]}"; do
if [ -f $profile ]; then
. $profile
fi
done
# mac
if [ -d /opt/homebrew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
export BASH_SILENCE_DEPRECATION_WARNING=1
fi
if [ -d "$(python3 -m site --user-base)/bin" ]; then
export PATH="$PATH:$(python3 -m site --user-base)/bin"
fi
# gh
if command -v gh &>/dev/null; then
eval "$(gh completion -s bash)"
gh alias import ~/.config/gh/aliases.yml --clobber &>/dev/null
fi
# wsl
if [ -d "$HOME/.local/bin" ]; then
export PATH="$PATH:$HOME/.local/bin"
fi