-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
214 lines (171 loc) · 5.08 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Created by Zap installer
[ -f "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh" ] && source "${XDG_DATA_HOME:-$HOME/.local/share}/zap/zap.zsh"
plug "zsh-users/zsh-autosuggestions"
plug "zap-zsh/supercharge"
plug "zap-zsh/zap-prompt"
# plug "jgregoire/agnoster-custom"
# eval "$(croque init zsh)"
eval "$(starship init zsh)"
# Load and initialise completion system
# zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
# zstyle :compinstall filename '/home/james/.zshrc'
# zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
autoload -Uz compinit
compinit
bindkey -e
plug "Aloxaf/fzf-tab"
zstyle ':completion:*:git-checkout:*' sort false
zstyle ':completion:*:descriptions' format '[%d]'
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
zstyle ':fzf-tab:*' switch-group '<' '>'
plug "zsh-users/zsh-syntax-highlighting"
##
## Add directories to default PATH
##
pathdirs=(
~/Scripts
~/.local/bin
)
# Now we make sure they exist before adding them
for dir in $pathdirs; do
if [ -d $dir ]; then
path+=$dir
fi
done
# Set title style
case $TERM in
*term*)
chpwd () {print -Pn "\e]0;%n@%M %~\a"}
;;
esac
##
## History Settings
##
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt APPEND_HISTORY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_VERIFY
##
## Other Settings
##
# Stops pesky Ctrl-S halting terminal
setopt NO_FLOW_CONTROL
# Don't kill backgrnd processes when exiting shell
setopt AUTO_CONTINUE
# Watch other users login/out
watch=notme
##
## Globbing Settings
##
setopt EXTENDED_GLOB
setopt NUMERIC_GLOB_SORT
##
## Aliases
##
alias fire='rpicam-still -n --timelapse=1000ms --datetime'
# Give up and start over
# by calling `$ git unfuck`
alias 'unfuck'='git reset --hard HEAD'
# systemd
alias ssc='sudo systemctl'
alias ssu='systemctl --user'
# ncmpcpp remote host
# I set MPD_HOST and MPD_PORT in .zprofile now.
# alias ncmp='ncmpcpp -h $MPD_HOST -p 6600'
# Music Syncing
#alias rsyncpm='rsync -av --size-only --force --del /home/james/Music/ /home/james/Marconi/Music/.'
alias rsyncpm='adbsync --del --show-progress push Music/ /storage/emulated/0/Music'
# alias rsyncpp='rsync -av --size-only /var/lib/mpd/playlists/ /home/james/Marconi/Music/.'
alias rsynccm='rsync -av --force --del james@heaviside:/media/pidrive/Music/. Music/. && tput bel'
# BEST ALIAS EVER
alias fucking='sudo'
# Add color
alias ls='ls -lh --color --group-directories-first'
alias la='ls -a' # Also show hidden files
alias lsd='ls /dev | grep sd'
alias grep='grep --color'
# Exa
alias exa='eza -l --group-directories-first --icons' # exa maintainer MIA.
alias exaa='exa -a'
alias exag='exa -a --git'
alias exat='exa -T'
alias exaat='exaa -T'
## Nano
# Nano using line numbers
alias nano='nano -c'
# Use neovim instead of vi
alias vi='nvim'
# Use neovim instead of vim
alias vim='nvim'
# Use nvim with user rc file for sudo. EDITOR set in .zprofile.
alias svi='sudoedit'
# dc undoes cd! \o/
setopt AUTO_CD
setopt AUTO_PUSHD
setopt PUSHD_SILENT
setopt PUSHD_TO_HOME
alias dc='popd'
# Aliases for safety
setopt RM_STAR_WAIT
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
## Torrent Box Aliases
alias drt='dtach -a /home/james/.rtorrent.dtach'
alias drtu='sudo start-stop-daemon --start --chuid james --name rtorrent --exec /usr/bin/dtach -- -n /home/james/.rtorrent.dtach /usr/bin/rtorrent'
alias drtd='sudo start-stop-daemon --stop --name rtorrent'
# Install shit quicker, apt edition
alias agi='sudo apt install --autoremove'
alias agu='sudo apt update && sudo apt-get upgrade'
alias agr='sudo apt remove --autoremove'
# Install shit quicker, pacman edition
alias pacman='pacman --color auto'
alias pacs='sudo pacman -S'
alias pacr='sudo pacman -Rsn'
alias pacsu='sudo pacman -Syyu'
alias pacc='sudo pacman -Sc'
# Install shit quicker, AUR edition
alias auri='makepkg -sic'
# Randomize wallpaper
# alias rwp='feh --randomize --bg-fill /home/james/Pictures/Desktops/21x9/3440x1440'
# Beets
alias bim='beet import'
# Volume control (pulse)
# e.g. '$ vol 50%'
# alias vol='pactl set-sink-volume 1'
alias luamake='/home/james/Code/lua-language-server/3rd/luamake/luamake'
##
## Keybinds
##
# Fix keybinds
bindkey '^K' kill-whole-line
bindkey "\e[1~" beginning-of-line # Home (console)
bindkey "\e[H" beginning-of-line # Home (xterm)
bindkey "\e[4~" end-of-line # End (console)
bindkey "\e[F" end-of-line # End (xterm)
bindkey "\e[2~" overwrite-mode # Ins
bindkey "\e[3~" delete-char # Delete
# Magic space!?
bindkey -M viins ' ' magic-space
# Separate man page sections. Neat.
zstyle ':completion:*:manuals' separate-sections true
# Show ... while processing completion, so we know it's working
expand-or-complete-with-dots() {
echo -n "\e[36m...\e[0m"
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
# WSL likes to start us somewhere besides the home directory. Fix that.
cd
# In WSL, jump to Windows home dir
alias cdh='cd /mnt/c/Users/jfg'
# That's all, folks!