-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
128 lines (112 loc) · 3.63 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
# Init
echo ""
echo ""
eval "$(zoxide init zsh)"
eval "$(starship init zsh)"
cfonts " untemi #!" -a left -f tiny -g "#f7768e","#7aa2f7" --transition-gradient -s
autoload -Uz compinit
autoload edit-command-line; zle -N edit-command-line
# fpath=($HOME/.local/share/zsh-plugins/zsh-completions/src/ $fpath)
zstyle ":completion:*" menu select
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
compinit
_comp_options+=(globdots)
compdef -d trash
setopt autocd
stty stop undef
setopt interactive_comments
# Disabling vi sorry i had to
bindkey -e
unset VICMD
# Plugins
source "$HOME/.local/share/zsh-plugins/sudo-prefix.zsh"
source "$HOME/.local/share/zsh-plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$HOME/.local/share/zsh-plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
source "$HOME/.local/share/zsh-plugins/zsh-history-substring-search/zsh-history-substring-search.zsh"
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
# Alias
alias ls="exa --icons -A --group-directories-first"
alias ll="eza -Al --color=always --group-directories-first"
alias tree="eza --color=always --icons --tree"
alias grep="rg"
alias gtop="sudo intel_gpu_top"
alias pmu="sudo pacman -Syu"
alias c="clear"
alias myip="curl ip.me"
alias cd="z"
alias lspkg="pacman -Qq | fzf --preview 'pacman -Qil {}' --layout=reverse --bind 'enter:execute(pacman -Qil {} | less)'"
alias clipdown="yt-dlp -S 'res:1080' -o ~/Videos/Clips/"
alias rm="trash"
alias apt-get="apt"
alias lf="lfub"
alias dotfiles='/usr/bin/git --git-dir=$HOME/.local/share/dotfiles --work-tree=$HOME'
alias neofetch="fastfetch -c neofetch.jsonc"
alias wsong="yt-dlp --audio-format mp3 -x"
alias goclean="\rm /tmp/go-build* -r"
alias svim="EDITOR=nvim sudo -e"
alias pyenv="source ~/Development/Python/env/bin/activate"
alias pyenvrun="~/Development/Python/env/bin/python"
alias yapa="/usr/bin/ya"
alias imgup="~/.local/appimage/appimageupdatetool-x86_64.AppImage ~/.local/appimage/* -r"
alias x="chmod +x"
# Functions
keyb() {
xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'
}
godoc() {
curl curl -s cht.sh/go/{$1}
}
upall() {
echo "\033[38;5;10m--- PacMan ---\033[0m"
yay --noconfirm
echo "\n\033[38;5;10m--- PacMan CleanUp ---\033[0m"
yay -Sc --noconfirm
echo "\n\033[38;5;10m--- Flatpak Update ---\033[0m"
flatpak update --noninteractive
echo "\n\033[38;5;10m--- Flatpak CleanUp ---\033[0m"
flatpak uninstall --unused --delete-data --noninteractive
echo "\n\033[38;5;10m--- AppImage Update ---\033[0m"
imgup
echo "\n\033[38;5;10m--- Yazi plugins Update ---\033[0m"
yapa pack -u
}
apt() {
echo "Bro we are not on Debian or Ubuntu or a shitty distro"
sleep 3
echo "Wait are you fucking DUMB ???"
sleep 2
echo "THIS IS ARCH YOU DUMBASS"
sleep 1
echo "ok Fuck off"
sleep 2
exit
}
ya() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
yazi "$@" --cwd-file="$tmp"
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
cd "$cwd"
fi
\rm -f -- "$tmp"
}
function osc7-pwd() {
emulate -L zsh # also sets localoptions for us
setopt extendedglob
local LC_ALL=C
printf '\e]7;file://%s%s\e\' $HOST ${PWD//(#m)([^@-Za-z&-;_~])/%${(l:2::0:)$(([##16]#MATCH))}}
}
function chpwd-osc7-pwd() {
(( ZSH_SUBSHELL )) || osc7-pwd
}
add-zsh-hook -Uz chpwd chpwd-osc7-pwd
# Keybinds
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey '^[s' sudo-command-line
bindkey '^[e' edit-command-line
bindkey '^H' backward-kill-word
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word