-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bash_profile
87 lines (72 loc) · 2.08 KB
/
.bash_profile
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
# Autostart X at login
# https://wiki.archlinux.org/title/Xinit#Autostart_X_at_login
if [[ -z "${DISPLAY}" ]] && [[ "${XDG_VTNR}" -eq 1 ]]; then
exec startx
fi
# ssh agent setup
# auto start by systemd: $HOME/.config/systemd/user/ssh-agent.service
# eval `ssh-agent` > /dev/null 2>&1
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
eval `ssh-add ~/.ssh/id_ed25519 > /dev/null 2>&1`
# Load darwin
if [[ "$(uname)" == 'Darwin' ]]; then
test -r ~/.bash_profile.darwin && . ~/.bash_profile.darwin
fi
# Bash
HISTSIZE=100000
HISTFILESIZE=100000
HISTTIMEFORMAT='%Y-%m-%dT%H:%M:%S '
# Editor
export EDITOR=vim
# fzf
if [[ -r /usr/share/fzf/key-bindings.bash ]]; then
. /usr/share/fzf/key-bindings.bash
fi
if [[ -r /usr/share/fzf/completion.bash ]]; then
. /usr/share/fzf/completion.bash
fi
# Git
export PATH="${PATH}:/usr/local/share/git-core/contrib/diff-highlight"
# Python
export PYTHONDONTWRITEBYTECODE=1
export PYTHONUSERBASE=~/.local
# export PATH="${PATH}:${PYTHONUSERBASE}/bin"
export PATH="${PATH}:${HOME}/.poetry/bin"
source "$HOME/.rye/env"
# Go
export PATH="${PATH}:$(go env GOPATH)/bin"
# Node
export PATH="${PATH}:${HOME}/.local/bin"
export npm_config_prefix="$HOME/.local"
eval "$(nodenv init -)"
# Docker
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
# Google Cloud SDK
if [[ -r ~/google-cloud-sdk/path.bash.inc ]]; then
. ~/google-cloud-sdk/path.bash.inc
fi
if [[ -r ~/google-cloud-sdk/completion.bash.inc ]]; then
. ~/google-cloud-sdk/completion.bash.inc
fi
#
# Prompt
#
# Git
source ~/.git-prompt.sh
source ~/.git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
if [[ -z "${PS1}" ]]; then
return
else
PS1=''
PS1=${PS1}'\[\033[32m\]\u@\h\[\033[00m\]' # user@host
PS1=${PS1}'% ' # %
PS1=${PS1}'\[\033[34m\]\W\[\033[00m\]' # workdir
PS1=${PS1}'\[\033[31m\]$(__git_ps1)\[\033[00m\] ' # Git branch
PS1=${PS1}'\[\033[00m\]\$ ' # $
fi
# Load local
test -r ~/.bash_profile.local && . ~/.bash_profile.local
# Load rc
test -r ~/.bashrc && . ~/.bashrc