-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.shell_defaults
156 lines (125 loc) · 4.23 KB
/
.shell_defaults
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
# vim: ft=sh
# ENVIRONMENT VARIABLES #
#########################
# No brainer, default to Vim
alias vim="nvim"
export EDITOR="vim"
export VIMCONFIG="$HOME/.vim"
export VIMDATA="$HOME/.vim"
# Tmux auto title
export DISABLE_AUTO_TITLE="true"
# GPG Configuration
export GPG_TTY=$(tty)
# Color LS output to differentiate between directories and files
export LS_OPTIONS="--color=auto"
export CLICOLOR="Yes"
export LSCOLOR=""
# Set Path
export PATH=$HOME/.bin:$HOME/.local/bin:$HOME/bin:$HOME/.cargo/bin:/usr/lib64/ccache:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/sbin:$PATH
# Add Gcloud to the path
export PATH="$PATH:/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin"
# Add Rust/Cargo to the path
export PATH="$HOME/.cargo/bin:$PATH"
if [[ -s $HOME/.cargo/env ]] ; then
source $HOME/.cargo/env
fi
# ALIASES #
###########
# Standard Shell
alias c='clear'
alias l='ls -al'
alias bloat='du -k | sort -nr | more'
alias sc='systemctl'
alias jc='journalctl'
# Bundle Exec
alias be="bundle exec"
# Git
alias g='git status -s'
alias ga='git add --all'
alias gb='git branch'
alias gc='git commit -m'
alias gca='git commit -am'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gl='git log --oneline'
# tmux
alias switch='tmux switch-session -t'
alias tmk='tmux kill-session -t'
alias tls='tmux ls'
alias load='tmuxp load'
attach() {
if [ -z "$1" ]
then
tmux attach-session -t 0
else
tmux attach-session -t "$1"
fi
}
# Docker
alias de='docker exec'
alias dclean='docker ps -a -q -f status=exited | xargs -t docker rm'
alias diclean='docker images -q -f dangling=true | xargs -t docker rmi'
alias dvclean='docker volume ls -q -f dangling=true | xargs -t docker volume rm'
alias dgc='dclean && diclean && dvclean'
alias dps='docker ps'
alias dstop='docker stop `docker ps -q`'
# Docker Compose
alias dc='docker-compose'
alias dcu='docker-compose up'
alias dcr='docker-compose run --rm'
# Flush DNS Cache
alias dnsflush='dscacheutil -flushcache; sudo killall -HUP mDNSResponder'
# Reload SHELL
alias r='exec $SHELL'
# Ripgrep as Silver Searcher
if ! command -v ag &> /dev/null; then alias ag=rg; fi
# Tmux project orchestration
function rdev() {
WORKSPACE=$1 tmuxp load ~/.tmuxp/rails_dev.yaml
}
# Dev setup
[ -f /opt/dev/dev.sh ] && source /opt/dev/dev.sh
# Keychain loader if present
type keychain >/dev/null 2>&1 && eval `keychain --agents ssh --eval ~/.ssh/id_ed25519`
# asdf setup
if [ -e $HOME/.asdf/asdf.sh ]; then
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
fi
# Nix setup
if [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ]; then . $HOME/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer
# Chruby setup
if [[ -f /usr/local/share/chruby/chruby.sh ]]; then
source /usr/local/share/chruby/chruby.sh
elif [[ -f /opt/dev/sh/chruby/chruby.sh ]]; then
source /opt/dev/sh/chruby/chruby.sh
elif [[ -f /home/linuxbrew/.linuxbrew/opt/chruby/share/chruby/chruby.sh ]]; then
source /home/linuxbrew/.linuxbrew/opt/chruby/share/chruby/chruby.sh
source /home/linuxbrew/.linuxbrew/opt/chruby/share/chruby/auto.sh
fi
# Load proper Ruby version
if command -v chruby >/dev/null 2>&1 && [[ -f $HOME/.ruby-version ]]; then
chruby $(cat $HOME/.ruby-version)
fi
# Direnv setup
type direnv >/dev/null 2>&1 && eval "$(direnv hook $SHELL)"
# Nvm setup
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# 1Password SSH Management in WSL
if [[ $OSTYPE == 'linux'* ]]; then
if [ -e $HOME/.agent-bridge.sh ]; then
source $HOME/.agent-bridge.sh
fi
fi
# spin shell_gpt setup
[[ -f $HOME/.secrets ]] && . $HOME/.secrets
[[ -f /etc/spin/secrets/openai-base-url ]] && export API_BASE_URL=$(cat /etc/spin/secrets/openai-base-url)
[[ -f /etc/spin/secrets/openai-base-url ]] && export OPENAI_BASE_URL=$(cat /etc/spin/secrets/openai-base-url)
[[ -f /etc/spin/secrets/openai-api-key ]] && export OPENAI_API_KEY=$(cat /etc/spin/secrets/openai-api-key)
# Fly.io setup
export FLYCTL_INSTALL="$HOME/.fly"
export PATH="$FLYCTL_INSTALL/bin:$PATH"
# Bluefin bling
test -f /usr/share/ublue-os/bluefin-cli/bling.sh && source /usr/share/ublue-os/bluefin-cli/bling.sh