-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.zshrc
More file actions
141 lines (124 loc) · 3.81 KB
/
.zshrc
File metadata and controls
141 lines (124 loc) · 3.81 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
# ---- PATHS ----
typeset -U path PATH # remove duplicates automatically
path=(
/opt/homebrew/bin
/opt/homebrew/sbin
$HOME/.cargo/bin
$HOME/.pub-cache/bin
$HOME/softwares/flutter/bin
/opt/homebrew/opt/mysql@8.4/bin
/opt/homebrew/opt/mongodb-community@4.4/bin
/Applications/Postgres.app/Contents/Versions/15/bin
~/.config/yazi
/Library/PostgreSQL/17/bin/
/opt/homebrew/opt/openjdk/bin
$path
)
export PATH
# Enable completion
autoload -Uz compinit
compinit -C -d "$HOME/.cache/zsh/.zcompdump"
# ---- FNM (Node version manager) ----
eval "$(fnm env --use-on-cd --shell zsh)"
# ---- rbenv ----
export RBENV_ROOT="$HOME/.rbenv"
if command -v rbenv >/dev/null; then
eval "$(rbenv init - zsh)"
fi
# Useful options
setopt autocd
setopt correct
setopt interactivecomments
setopt PROMPT_SUBST
# Colors
autoload -Uz colors
colors
# Editor
export EDITOR=nvim
export VISUAL=nvim
# Git branch in prompt (fast, no oh-my-zsh)
git_branch() {
local branch
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) || return
echo " %F{yellow}($branch)%f"
}
PROMPT='%F{cyan}%~%f$(git_branch) '
# ---- History ----
HISTFILE="$HOME/.zsh_history"
HISTSIZE=100000
SAVEHIST=100000
setopt appendhistory # don’t overwrite
setopt sharehistory # share across terminals
setopt hist_ignore_dups # no consecutive duplicates
setopt hist_ignore_all_dups # remove older duplicates
setopt hist_reduce_blanks # trim extra spaces
setopt hist_verify # show command before executing from history
setopt inc_append_history # write immediately
# ---- zoxide (smart cd) ----
eval "$(zoxide init zsh)"
# ---- Autosuggestions ----
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# ---- yazi file manager ----
if [ -f "$HOME/.dotfiles/.config/yazi/y.sh" ]; then
source "$HOME/.dotfiles/.config/yazi/y.sh"
fi
# ---- fzf ----
if [ -f /opt/homebrew/opt/fzf/shell/key-bindings.zsh ]; then
source /opt/homebrew/opt/fzf/shell/key-bindings.zsh
fi
if [ -f /opt/homebrew/opt/fzf/shell/completion.zsh ]; then
source /opt/homebrew/opt/fzf/shell/completion.zsh
fi
export FZF_DEFAULT_OPTS='
--height 40%
--layout=reverse
--border
--inline-info
--cycle
'
# ---- Syntax Highlighting (must be last) ----
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# ---- Aliases ----
alias bd='bun dev || bun start'
alias cls="clear"
alias dc='docker compose'
alias duh='du -h -d 0 */ | sort -h'
alias gc='git branch | fzf --height=20% --reverse --info=inline | xargs git checkout'
alias gco='git checkout'
alias gpull="git pull"
alias gpush="git push"
alias gst="git status"
alias ishell='cd ~/codes/tl/aicrete/qualitycontrol && uv run --env-file .env python3 qcsystem/manage.py shell_plus'
alias l="eza -l"
alias la="eza -la"
alias ll="eza -l"
alias lf="y"
alias ls="eza"
alias nv="nvim"
alias pb='pnpm build'
alias pd='pnpm dev'
alias pi='pnpm install'
alias pip="pip3"
alias py="python3"
alias python="python3"
alias rconsole='rails c'
alias rserver='rails s'
alias run='cd ~/codes/tl/aicrete/qualitycontrol && uv run --env-file .env python3 qcsystem/manage.py runserver'
alias ssh-prod='aic ssh-ecs -e prod -a prod -s web'
alias ssh-qa2='aic ssh-ecs -e staging -a qa2 -s web'
alias ssh-qa='aic ssh-ecs -e staging -a qa -s web'
alias tr2='tree -a -L 2'
alias ur='uv run'
alias vi="nvim"
alias yb='yarn build'
alias yd='yarn dev || yarn start'
alias ys='yarn start'
alias yt='yarn test'
alias ytdl='yt-dlp -f bestaudio --no-playlist --extract-audio --audio-format mp3 -o "~/Downloads/ytdlc/%(title)s.%(ext)s"'
alias zob='cd /Users/sameer/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/obsidian/'
export DEBUG=1
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
fpath=(/Users/sameer/.docker/completions $fpath)
autoload -Uz compinit
compinit
# End of Docker CLI completions