-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
192 lines (147 loc) · 4.32 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
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
188
189
190
191
192
export ZSH="$HOME/.oh-my-zsh"
export TERM="xterm-256color"
export EDITOR="nvim"
if [[ $USER != "root" ]]; then
export STARSHIP_CONFIG=~/.config/starship.toml
eval "$(starship init zsh)"
export GPG_TTY=$(tty)
export PATH=$HOME/.local/share/nvim/mason/bin:$HOME/.nimble/bin:$HOME/bin:/usr/local/bin:$HOME/.deno/bin:$HOME/.cargo/bin:$HOME/.spicetify:$HOME/.local/share/coursier/bin:$HOME/.local/bin:$HOME/.local/share/fnm:$HOME/go/bin/:/usr/local/go/bin:$PATH
export PATH=/usr/lib/android-sdk/emulator/:/usr/lib/android-sdk/cmdline-tools/latest/bin:$HOME/flutter/bin:$PATH
fpath=(~/.zsh $fpath)
autoload -Uz compinit compinit -u
# fnm
eval "$(fnm env --use-on-cd)"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
[[ ! -r /home/iperez/.opam/opam-init/init.zsh ]] || source /home/iperez/.opam/opam-init/init.zsh > /dev/null 2> /dev/null
function node_package_manager {
if [ -f yarn.lock ]; then
yarn "$@"
elif [ -f package-lock.json ]; then
npm "$@"
else
yarn "$@"
fi
}
function chpwd() {
if [[ -f package.json ]]; then
fnm use --resolve-engines >/dev/null 2>/dev/null
fi
}
# bun completions
[ -s "/home/iperez/.bun/_bun" ] && source "/home/iperez/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# -------------| Alias |----------------
alias pm=node_package_manager
fi
function docker_connect() {
if docker ps >/dev/null 2>&1; then
container=$(docker ps | awk '{if (NR!=1) {print $NF}}' | fzf)
if [[ -n $container ]]; then
container_id=$(echo "$container" | awk -F ': ' '{print $1}')
docker exec -it "$container_id" /bin/sh
else
echo "No container selected"
fi
else
echo "Docker is not running"
fi
}
COMPLETION_WAITING_DOTS="true"
_Z_NO_RESOLVE_SYMLINKS="true"
ZSH_COLORIZE_TOOL=chroma
ZSH_COLORIZE_STYLE=vim
ZSH_DISABLE_COMPFIX=true
plugins=(
colorize
zsh-syntax-highlighting
zsh-autosuggestions
zsh-interactive-cd
urltools
taskwarrior
)
source $ZSH/oh-my-zsh.sh
# ----| Commands |----
# Ubuntu
alias apt="nala"
alias apt-get="nala"
alias vi="nvim $1"
alias v.="nvim ."
alias mk="mkdir $1"
alias zathura="nohup zathura $1"
alias ls="exa --group-directories-first --icons"
alias la="ls --group-directories-first --icons -a"
alias cat="bat --style=plain --paging=never"
alias tree="exa -T --icons"
alias grep="grep --color=auto"
alias ng="npm init -y && git init"
alias nd="npm i -D $1"
alias ns="npm i $1"
alias t="tree $1"
alias paru="paru --bottomup $1"
alias sudo='sudo '
alias c.='code .'
alias f='vifm'
alias rm='rm -i'
alias grep="grep --color=auto"
alias cat="bat --style=plain --paging=never"
alias mk="mkdir $1"
alias zathura="nohup zathura $1"
alias ls="eza --group-directories-first --icons"
alias la="eza --group-directories-first --icons -a"
alias ll="eza --group-directories-first --icons -l"
alias cat="bat --style=plain --paging=never"
alias tree="eza -T --icons"
alias grep="grep --color=auto"
alias t="tree $1"
alias paru="paru --skipreview --bottomup $1"
alias up="docker compose up"
alias upt="docker compose -f docker-compose.test.yml up --abort-on-container-exit"
alias down="docker compose down"
alias downt="docker compose -f docker-compose.test.yml down"
alias dconnect="docker_connect"
# Git
alias g="git"
alias gclone="g clone"
# Add
alias gaa="git add -A"
# Branch
alias gb="git branch"
alias gba="git branch --all --verbose"
# Checkout
alias gco="git checkout"
alias gbc="git checkout -b"
# Commit
alias gc="git commit --verbose"
# Status
alias gs="git status -sb"
# Fetch
alias gf="git fetch --all -p"
# Push
alias gps="git push"
# Pull
alias gpl="git pull"
# Merge (m)
alias gm='git merge'
# Rebase (r)
alias gr='git rebase'
alias gra='git rebase --abort'
alias grc='git rebase --continue'
alias gri='git rebase --interactive'
alias grs='git rebase --skip'
# Working Copy
alias gd="git diff --no-ext-diff --cached"
alias dot="g --git-dir ~/.dotfiles --work-tree ~"
# Workspace
export DEV="~/dev/personal"
export DEV_HOULAK="~/dev/work/Houlak"
alias dv="cd $DEV"
alias dh="cd $DEV_HOULAK"
alias aws-houlak="awsume HOULAK"
alias note="cd ~/.notes"
alias vn="nvim ~/.notes"
eval "$(atuin init zsh)"
source $HOME/.atuin_zshrc