-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
151 lines (125 loc) · 3.87 KB
/
.zshrc
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
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set a faster theme to improve startup time.
ZSH_THEME="agnoster" # You can change this to another minimal theme if you prefer.
DEFAULT_USER="$USER"
# Enable case-insensitive completion.
CASE_SENSITIVE="false"
# Load only essential plugins to reduce load time.
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
# Source Oh My Zsh.
source $ZSH/oh-my-zsh.sh
# User configuration.
# Set up your PATH environment variable.
export PATH="$HOME/bin:/usr/local/bin:$PATH"
# Add other paths (e.g., Node.js, Python, etc.).
export PATH="$HOME/.local/bin:$PATH"
# Set default editor.
export EDITOR='nvim' # Change to your preferred editor.
# Language settings.
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Aliases for productivity.
alias ll='ls -lah'
alias la='ls -A'
alias l='ls -CF'
alias gs='git status'
alias gd='git diff'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gp='git pull'
alias gP='git push'
alias gl='git log --oneline --graph --decorate'
alias ..='cd ..'
alias ...='cd ../..'
alias c='clear'
alias h='history'
alias mkdir='mkdir -pv'
alias lg='lazygit'
alias dc='docker compose'
alias tks='tmux kill-session'
alias ve='~/dev/dotfiles/tmux/vash-esports.sh'
alias rdb='sail artisan migrate:fresh; sail artisan db:seed'
alias vash='sail artisan'
alias ss='~/dev/dotfiles/tmux/stikstof.sh'
alias mko='~/dev/dotfiles/tmux/distributor.sh'
alias pw='~/dev/dotfiles/tmux/personal-website.sh'
# Enable aliases to be sudo'ed.
alias sudo='sudo '
# NVM (Node Version Manager) with lazy loading.
export NVM_DIR="$HOME/.nvm"
export NVM_LAZY_LOAD=true
if [[ $NVM_LAZY_LOAD == true ]]; then
nvm() {
unset -f nvm
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm "$@"
}
fi
# Load Bun if installed.
if [ -s "$HOME/.bun/bin/bun" ]; then
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
fi
# Load Deno if installed.
if [ -s "$HOME/.deno/bin/deno" ]; then
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
fi
# Load kubectl completions on demand.
if command -v kubectl &>/dev/null; then
source <(kubectl completion zsh)
fi
# Load Google Cloud SDK if installed.
if [ -f "$HOME/google-cloud-sdk/path.zsh.inc" ]; then
source "$HOME/google-cloud-sdk/path.zsh.inc"
fi
if [ -f "$HOME/google-cloud-sdk/completion.zsh.inc" ]; then
source "$HOME/google-cloud-sdk/completion.zsh.inc"
fi
export AWS_REGION=eu-west-1
# Functions for productivity.
# Extract function to handle various archive types.
extract() {
if [ -f "$1" ] ; then
case "$1" in
*.tar.bz2) tar xjf "$1" ;;
*.tar.gz) tar xzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xf "$1" ;;
*.tbz2) tar xjf "$1" ;;
*.tgz) tar xzf "$1" ;;
*.zip) unzip "$1" ;;
*.Z) uncompress "$1" ;;
*.7z) 7z x "$1" ;;
*) echo "'$1' cannot be extracted via this function" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# Create a directory and navigate into it.
mkcd() {
mkdir -p "$1" && cd "$1"
}
# Git branch in prompt.
parse_git_branch() {
git branch 2>/dev/null | sed -n '/\* /s///p'
}
# Load zsh-autosuggestions if installed.
if [ -f "$ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" ]; then
source "$ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
fi
# Load zsh-syntax-highlighting if installed.
if [ -f "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]; then
source "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
fi
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /opt/homebrew/bin/terraform terraform