-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
149 lines (113 loc) · 3.35 KB
/
zshrc
File metadata and controls
149 lines (113 loc) · 3.35 KB
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
# native profiler (call zprof at end of file)
# zmodload zsh/zprof
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/toban/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# zsh options
setopt autocd
unsetopt beep
setopt correct
setopt noclobber
# NOTE: export environment variables in .zshenv so they are available to i3 and dmenu
# shorthand for zsh calculator: e.g., `= 2.0/3`
function = {
echo "$(($@))"
}
# drop back down to parent ranger session instead of nested instance
rr() {
if [ -z "$RANGER_LEVEL" ]
then
ranger
else
exit
fi
}
#===================================
# PLUGINS
#
# First install `zplug` from AUR (or install directly)
#===================================
# load zplug
source /usr/share/zsh/scripts/zplug/init.zsh # AUR install location
# sane options
zplug willghatch/zsh-saneopt
# 256 color terminal
zplug chrissicool/zsh-256color
# dependency for pure prompt
zplug mafredri/zsh-async, from:github
# pure prompt
zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme
# pure-compatible vim-mode extension
zplug laurenkt/zsh-vimto
# autosuggestions
zplug zsh-users/zsh-autosuggestions
# syntax highlighting
zplug zsh-users/zsh-syntax-highlighting
# notifications for long-running commands
zplug marzocchi/zsh-notify
# extended completions
zplug zsh-users/zsh-completions
# taskwarrior completions
zplug plugins/taskwarrior, from:oh-my-zsh
# all-in-one extracter
zplug plugins/extract, from:oh-my-zsh
# colored man pages
zplug plugins/colored-man-pages, from:oh-my-zsh
# liquidprompt (disable for pure)
#zplug nojhan/liquidprompt
# enhanced vi mode (disable for pure)
#zplug plugins/vi-mode, from:oh-my-zsh
# let FZF handle tab-completion
zplug Aloxaf/fzf-tab
# install new plugins
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
# source plugins and add commands to PATH
zplug load
# for zsh-completions plugin to handle pip3
compctl -K _pip_completion pip3
## fzf-tab configs
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
# set descriptions format to enable group support
zstyle ':completion:*:descriptions' format '[%d]'
# set list-colors to enable filename colorizing
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# preview directory's content with exa when completing cd
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
# switch group using `,` and `.`
zstyle ':fzf-tab:*' switch-group ',' '.'
# fzf bindings (load after plugins)
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh
#===================================
# ALIASES
#===================================
# some pacman/pacmatic convenience aliases
alias pacup='sudo -E pacmatic -Syu'
alias pacin='sudo -E pacmatic -S'
alias pacinfo='pacman -Qi'
# pacsearch is already provided
alias oldvim='/usr/bin/vim'
alias vim='nvim'
alias vimdiff='nvim -d'
# -i for interactive. Prompts before overwriting/removing.
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias mkdir='mkdir -p' # automatically make parents
alias ls='ls -h --color=auto --group-directories-first'
alias ll='ls -Alv'
# end profiling
# zprof