-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
executable file
·185 lines (149 loc) · 5.98 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
# zmodload zsh/zprof
# skip_global_compinit=1
# [ "$(tty)" = "/dev/tty1" ] && exec startx;
[ "$(tty)" = "/dev/tty1" ] && exec sway;
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/usr/local/sbin:/sbin:$HOME/.cargo/bin:$HOME/.local/bin:$HOME/.local/share/nvim/mason/bin/:$HOME/.rustup/:/usr/lib/"
PATH=$PATH:$HOME/.cargo/bin
autoload -Uz is-at-least
########################################################
# ANTIDOTE ##
########################################################
zstyle ':antidote:bundle' use-friendly-names 'yes'
source ${ZDOTDIR:-~}/.antidote/antidote.zsh
autoload -Uz compinit
ZSH_COMPDUMP=${ZSH_COMPDUMP:-${ZDOTDIR:-~}/.zcompdump}
# cache .zcompdump for about a day
if [[ $ZSH_COMPDUMP(#qNmh-20) ]]; then
compinit -C -d "$ZSH_COMPDUMP"
else
compinit -i -d "$ZSH_COMPDUMP"; touch "$ZSH_COMPDUMP"
fi
{
# compile .zcompdump
if [[ -s "$ZSH_COMPDUMP" && (! -s "${ZSH_COMPDUMP}.zwc" || "$ZSH_COMPDUMP" -nt "${ZSH_COMPDUMP}.zwc") ]]; then
zcompile "$ZSH_COMPDUMP"
fi
} &!
# initialize plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txt
# antidote load ${ZDOTDIR:} ${ZDOTDIR:-~}/zplugins.txt
antidote load ${ZDOTDIR:-~}/.zplugins.conf
antidoteDir="$HOME/.cache/antidote"
source "$antidoteDir/romkatv/powerlevel10k/powerlevel10k.zsh-theme"
########################################################
# OPTIONS ##
########################################################
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
unsetopt beep
bindkey -e
setopt +o nomatch
# setopt multios # enable redirect to multiple streams: echo >file1 >file2
# setopt long_list_jobs # show long list format job notifications
# setopt interactivecomments # recognize comments
# The following lines were added by compinstall
zstyle :compinstall filename $HOME'/.zshrc'
source ~/.creds.sh
export EDITOR=nvim
export VISUAL=nvim
export GCM_CREDENTIAL_STORE=cache
export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/.ripgreprc"
export MANROFFOPT="-c"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export MANROFFOPT="-c"
export BAT_THEME="Catppuccin-mocha"
export BAT_PAGER="less"
export EZA_COLORS="da=38;5;240"
export ZSH_AUTOSUGGEST_STRATEGY=(completion)
export ZVM_VI_INSERT_ESCAPE_BINDKEY=jk
export ZVM_CLIP_COPY=xclip
export ZVM_CLIP_PASTE=xclip
# pyenv
export PYENV_ROOT=$HOME/.pyenv
[[ -d $PYENV_ROOT/bin ]] && export PATH=$PYENV_ROOT/bin:$PATH
eval "$(pyenv init -)"
# _evalcache dircolors
eval "$(dircolors)"
zstyle ':completion:*' menu select
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
eval "$(zoxide init zsh)"
########################################################
# ALIASES ##
########################################################
# eza aliases
alias l="eza -1 --icons --color=always"
alias ls="eza --icons --color=always"
alias la='eza -a --icons --color=always'
alias lc='eza -1 --icons=never --color=never'
alias lca='eza -1a --icons=never --color=never'
alias ld='eza -D --icons --color=always'
alias ll='eza -l --icons --git --color=always --no-user --time-style long-iso'
alias lla='eza -la --icons --git --color=always --time-style long-iso'
alias lS='eza -las size --icons --git --color=always --no-user --time-style long-iso --total-size'
alias lSd='eza -lDas size --icons --git --color=always --no-user --time-style long-iso --total-size'
alias l2='eza -TL 2 --icons --git --color=always --no-user --time-style long-iso'
alias l3='eza -TL 3 --icons --git --color=always --no-user --time-style long-iso'
alias sshfs-aws='sudo sshfs -o allow_other,default_permissions,IdentityFile=/home/xempt/.ssh/Arch-Personal.pem admin@ec2-13-56-164-157.us-west-1.compute.amazonaws.com:/home/admin/ /mnt/ec2'
#bat aliases
alias bat='bat --color=always'
alias less='bat --color=always'
alias bathelp='bat --plain --language=help'
# alias lc='lolcat'
# #fzf aliases
# alias fd="cd \$(find . -type d -print | fzf)"
alias ff="fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'"
alias fv="nvim \$(fzf --preview 'bat --style=numbers --color=always --line-range :500 {}')"
alias fcd="cd \$(dirname ./\$(fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'))"
alias md='mkdir -p'
alias rd='rmdir'
alias python="python3"
alias py="python3"
alias cpwd="pwd | tr -d '\n' | pbcopy && echo 'pwd copied to clipboard'"
alias nv="nvim"
alias nvi="nvim -u $HOME/.config/nvim/vi.lua"
alias nvdb="nvim '+:DBUI'"
alias nvsql="nvim '+:SQLua'"
alias nvdbee="nvim '+:lua require(\"dbee\").open()'"
alias vi="nvim --clean"
alias nvs="nvim -u $HOME/.config/nvim/simple.lua"
alias tard="tar_peek"
alias open="xdg-open"
alias shutdown="systemctl poweroff"
alias reboot='systemctl reboot'
alias ':q'="exit"
########################################################
# FUNCTIONS ##
########################################################
# bat-colored man pages
function help() {
"$@" --help 2>&1 | bathelp
}
# function to peek inside archives
# and see if suitable to extract in cwd
function tar_peek() {
depth="*/*";
tarReg="(.*((\.tar)|(\.tgz)|(\.tar.gz)))";
# tarReg=".*((\.tar)|(\.tgz)|(\.tar.gz))";
zipReg=".*(\.zip)$"
for file in "$@"; do
if [[ "$file" =~ $tarReg ]]; then
tar --exclude="$depth" -tf "$file"
elif [[ "$file" =~ $zipReg ]]; then
zipinfo -1 "$file" | grep -v "/."
fi
done;
}
function hideTitle() {
if [[ "$#" -eq 0 ]]; then
winid=$(xdotool getactivewindow)
xprop -id "$winid" -format _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS 2
else
xprop -name "$1" -format _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS 2
fi
}
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# zprof