-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbash_profile
More file actions
187 lines (144 loc) · 6.27 KB
/
bash_profile
File metadata and controls
187 lines (144 loc) · 6.27 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# To trace script performance
# set -x
# PS4='+\t '
# Auto append homebrew path
eval "$(/opt/homebrew/bin/brew shellenv)"
# Load the shell dotfiles, and then some:
for file in ~/.{aliases,aliases.local,aliases.private,bash_profile.local,bash_profile.host,bash_prompt,functions}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file";
done;
unset file;
export TERM_PROGRAM=iTerm.app
# Coloured man pages
export PAGER=most
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob;
# Append to the Bash history file, rather than overwriting it
shopt -s histappend;
# Share history in tmux sessions
shopt -s histreedit;
shopt -s histverify;
HISTCONTROL="ignoreboth"
PROMPT_COMMAND="history -a;history -c;history -r; $PROMPT_COMMAND";
# Autocorrect typos in path names when using `cd`
shopt -s cdspell;
# Enable some Bash 4 features when possible:
# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
# * Recursive globbing, e.g. `echo **/*.txt`
for option in autocd globstar; do
shopt -s "$option" 2> /dev/null;
done;
# Add tab completion for many Bash commands
LOCAL_BIN='/opt/homebrew/bin'
# Bash completion v1
# if which brew > /dev/null && [ -f "$(brew --prefix)/etc/bash_completion" ]; then
# source "$(brew --prefix)/etc/bash_completion";
# elif [ -f /etc/bash_completion ]; then
# source /etc/bash_completion;
# fi;
# Bash completion v2
[[ -r "/opt/homebrew/etc/profile.d/bash_completion.sh" ]] && . "/opt/homebrew/etc/profile.d/bash_completion.sh"
# Enable tab completion for `g` by marking it as an alias for `git`
# if type __git &> /dev/null && [ -f /opt/homebrew/etc/bash_completion.d/git-completion.bash ]; then
if type __git &> /dev/null && [ -f /opt/homebrew/etc/bash_completion.d/git-completion.bash ]; then
complete -o default -o nospace -F _git g;
# Add git completion to aliases
__git_complete g __git_main
__git_complete gb _git_branch
__git_complete grshard _git_branch
__git_complete gc _git_commit
__git_complete gd _git_diff
__git_complete gdep _git_diff
__git_complete gl _git_log
__git_complete gs _git_status
__git_complete gp _git_push
__git_complete gpo _git_checkout
__git_complete gpup _git_checkout
__git_complete gco _git_checkout
__git_complete gcl _git_clone
__git_complete grs _git_reset
__git_complete grb _git_rebase
__git_complete gsa _git_stash
__git_complete gsh _git_show
__git_complete gpl _git_pull
__git_complete grm _git_remote
__git_complete gtag _git_tag
fi;
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;
# Add tab completion for `defaults read|write NSGlobalDomain`
# You could just use `-g` instead, but I like being explicit
complete -W "NSGlobalDomain" defaults;
# Add `killall` tab completion for common apps
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal TweetDeck" killall;
# Docker alias auto complete
[ -e "$LOCAL_BIN/docker" ] && complete -F _docker d
[ -e "$LOCAL_BIN/docker-machine" ] && complete -F _docker_machine dm
[ -e "$LOCAL_BIN/docker-compose" ] && complete -F _docker_compose dk
#
# # Kubernetes
[ -e "$LOCAL_BIN/kubectl" ] && complete -F __start_kubectl k
[ -e "$LOCAL_BIN/minikube" ] && complete -F __start_minikube m
[ -e "$LOCAL_BIN/kops" ] && complete -o nospace -F __start_kops ko # Doesn't work
# Editor
export EDITOR='vim'
# LS Colors
export CLICOLOR=1
# Cheat Colors
export CHEATCOLORS=true
# Git
export GIT_SSL_NO_VERIFY=true
# Markdown viewer theme
export MDV_THEME=884.0134
# Github support
eval "$(hub alias -s)"
# Grep
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;33'
# Disable control flow shortcuts (C-s and C-q), so they can be used in vim
# Which also includes C-h, if not C-h will not work
# To prevent Error: stty: stdin isn't a terminal error in Claude code
# Run on interactive mode only
if [[ -t 0 ]]; then
stty -ixon -ixoff
bind '"\ex": backward-delete-char'
fi
[[ -s "$HOME/.avn/bin/avn.sh" ]] && source "$HOME/.avn/bin/avn.sh" # load avn
# To prevent unable to get local issuer certificate error
export NODE_TLS_REJECT_UNAUTHORIZED=1
# Default 9546 conflict with existing service
export HEALTH_PORT=9547
# Suppress shell deprecation warning in Catalina
export BASH_SILENCE_DEPRECATION_WARNING=1
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# FZH - Set up fzf key bindings and fuzzy completion
eval "$(fzf --bash)"
# Default command for FZF file search
# Glob options to ignore certain pattern
# --glob '!.git'
# export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --color=always --smart-case --colors "path:fg:198,120,221" --colors "line:fg:97,175,239" --colors "match:fg:40,44,52" --colors "match:bg:229,192,123"'
# export FZF_DEFAULT_COMMAND="rg --files --hidden --follow"
export FZF_DEFAULT_COMMAND="fd"
# export FZF_DEFAULT_OPTS='--color="fg:#ff0000,fg+:#ff0000,bg:#ff0000,hl:#ff0000"'
export FZF_CTRL_T_COMMAND="rg --files --hidden --follow"
export FZF_CTRL_T_OPTS="--preview-window='right:60%' --preview 'bat --style=numbers --color=always {}' --bind 'Ctrl-/:toggle-preview'"
export BAT_THEME='OneHalfDark'
export FZF_ALT_C_COMMAND="fd --type d"
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -n 20'"
export FZF_TMUX=1
export FZF_TMUX_OPTS="-d 40%"
# From brew install llvm for Clang compiler to commpile YouCompleteMe
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
# Add ./local/bin to $PATH
# . "$HOME/.local/bin/env"
# Configuration for node to trust the PayPal Proxy Certificates
export NODE_EXTRA_CA_CERTS='/usr/local/etc/openssl/certs/paypal_proxy_cacerts.pem'
export NPM_CONFIG_CAFILE='/usr/local/etc/openssl/certs/paypal_proxy_cacerts.pem'
# Set Git pager options, to ensure git diff window to follow the size of tmux window
export GIT_PAGER='less -+F -X'
### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT)
export PATH="/Users/hsiatono/.rd/bin:$PATH"
### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT)
# NVM
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm