-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc
158 lines (124 loc) · 4.84 KB
/
dot_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
zstyle ':z4h:' auto-update no
zstyle ':z4h:' start-tmux no
zstyle ':z4h:' term-shell-integration yes
zstyle ':z4h:' propagate-cwd yes
zstyle ':z4h:*' channel stable
zstyle ':z4h:autosuggestions' forward-char accept
zstyle ':z4h:fzf-complete' fzf-command my-fzf
zstyle ':z4h:(fzf-complete|fzf-dir-history|fzf-history)' fzf-flags --no-exact --color=hl:14,hl+:14
zstyle ':z4h:(fzf-complete|fzf-dir-history)' fzf-bindings 'tab:repeat'
zstyle ':z4h:fzf-complete' find-flags '(' -name '.git' -o -name node_modules ')' -prune -print -o -print
zstyle ':z4h:ssh:*' enable no
zstyle ':z4h:ssh:*' ssh-command command ssh
zstyle ':z4h:ssh:*' term 'xterm-256color'
zstyle ':z4h:ssh:*' send-extra-files '~/.zsh-aliases'
zstyle ':zle:(up|down)-line-or-beginning-search' leave-cursor yes
zstyle ':z4h:term-title:ssh' preexec '%* | %n@%m: ${1//\%/%%}'
zstyle ':z4h:term-title:local' preexec '%* | ${1//\%/%%}'
zstyle ':z4h:direnv' enable yes
zstyle ':completion:*:ssh:argument-1:' tag-order hosts users
zstyle ':completion:*:scp:argument-rest:' tag-order hosts files users
zstyle ':completion:*:(ssh|scp|rdp):*:hosts' hosts
# asahi hack
unset LIBGL_ALWAYS_SOFTWARE
if ! (( P9K_SSH )); then
zstyle ':z4h:sudo' term ''
fi
###
[ ! -f /etc/motd ] || cat /etc/motd
###
z4h install romkatv/archive || return
z4h init || return
####
zstyle ':completion:*' matcher-list "m:{a-z}={A-Z}" "l:|=* r:|=*"
####
fpath+=($Z4H/romkatv/archive)
autoload -Uz archive lsarchive unarchive edit-command-line
zle -N edit-command-line
my-fzf () {
emulate -L zsh -o extended_glob
local MATCH MBEGIN MEND
fzf "${@:/(#m)--query=?*/$MATCH }"
}
my-ctrl-z() {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line -w
else
zle push-input -w
zle clear-screen -w
fi
}
zle -N my-ctrl-z
###
z4h bindkey z4h-backward-kill-word Ctrl+Backspace
z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace
z4h bindkey z4h-kill-zword Ctrl+Alt+Delete
z4h bindkey backward-kill-line Ctrl+U
z4h bindkey kill-line Alt+U
z4h bindkey kill-whole-line Alt+I
z4h bindkey z4h-forward-zword Ctrl+Alt+Right
z4h bindkey z4h-backward-zword Ctrl+Alt+Left
z4h bindkey z4h-cd-back Alt+H
z4h bindkey z4h-cd-forward Alt+L
z4h bindkey z4h-cd-up Alt+K
z4h bindkey z4h-fzf-dir-history Alt+J
z4h bindkey my-ctrl-z Ctrl+Z
z4h bindkey edit-command-line Alt+E
z4h bindkey z4h-exit Ctrl+D
###
setopt GLOB_DOTS
setopt IGNORE_EOF
###
[ -z "$EDITOR" ] && export EDITOR='lvim'
[ -z "$VISUAL" ] && export VISUAL='lvim'
export DIRENV_LOG_FORMAT=
export FZF_DEFAULT_OPTS="--reverse --multi"
export SYSTEMD_LESS="${LESS}S"
###
z4h source -- /etc/bash_completion.d/azure-cli
z4h source -- /usr/share/LS_COLORS/dircolors.sh
z4h source -- $ZDOTDIR/.zsh-aliases
z4h source -- $ZDOTDIR/.zshrc-private
alias get="paru -S"
alias update="paru -Syu"
alias yeet="paru -Rcs"
alias rid="paru -R"
alias cl="paru -Sccd"
alias search="pacman -Qs"
alias task="gotop"
alias dua="baobab"
alias chmox="chmod +x"
alias neo="neofetch"
alias music="~/cmus-discord-rpc/target/release/cmus-discord-rpc & cmus"
alias see="kitty icat"
alias la="ls -al"
alias rm='rmtrash'
alias rmdir='rmdirtrash'
alias sudo='sudo '
alias ed="chezmoi edit --apply"
alias ad="~/added"
alias pu="chezmoi git push"
alias pl="chezmoi git pull"
alias gcs="chezmoi git status"
alias zc="chezmoi cd"
alias co="~/commit"
alias copu="~/copu"
alias priv="~/priv"
alias rn="mv"
alias v="~/.local/bin/lvim"
alias l="ls"
alias cls="clear"
alias clearl="clear;ls"
alias clss="clear;ls"
export EDITOR=lvim;
export VISUAL=lvim;
# export PATH="/opt/toolchains/gen/bin/:$PATH"
export ANDROID_HOME=/opt/android-sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:~/.local/share/gem/ruby/3.0.0/bin
mkcd () {
case "$1" in /*) :;; *) set -- "./$1";; esac
mkdir -p "$1" && cd "$1"
}