-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
115 lines (86 loc) · 3.67 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
#/usr/bin/env zsh
if [ "$(uname -s)" = "Darwin" ]; then
. "$HOME/.linuxify"
fi
. "$HOME/.bashrc"
# load in our path that will be searched for commands
# shellcheck source=.zpath
. "$HOME/.zpath"
# grab all of our zsh functions from ~/.zfuncs and mark them for autoloading
function () {
local -a zfuncs
for func in "$HOME"/.zfuncs/*(.); do
zfuncs+="$(basename $func)"
done
autoload -Uz "$zfuncs[@]"
}
# prompt & command configuration
setopt AUTOCD # automatically swap to a directory without requiring to type `cd`
setopt PROMPT_SUBST # enable parameter expansion, command substituion, and arithmetic expansion in prompts
setopt CORRECT # try to correct the spelling of our commands
setopt NO_LIST_BEEP # don't beep on an ambiguous completion
# directory stack
setopt AUTOPUSHD # automatically push directories into the stack
setopt PUSHDIGNOREDUPS # don't push duplicates into the directory stack
# history
HISTFILE="$HOME/.zsh_history"
HISTSIZE=10000000
SAVEHIST=10000000
setopt BANG_HIST # treat the '!' character specially during expansion
setopt EXTENDED_HISTORY # write the history file in the ":start:elapsed;command" format
setopt SHARE_HISTORY # share history between all sessions
setopt HIST_EXPIRE_DUPS_FIRST # expire duplicate entries first when trimming history
setopt HIST_IGNORE_DUPS # don't record an entry that was just recorded again
setopt HIST_IGNORE_ALL_DUPS # delete old recorded entry if new entry is a duplicate
setopt HIST_FIND_NO_DUPS # do not display a line previously found
setopt HIST_IGNORE_SPACE # don't record an entry starting with a space
setopt HIST_SAVE_NO_DUPS # don't write duplicate entries in the history file
setopt HIST_REDUCE_BLANKS # remove superfluous blanks before recording entry
setopt HIST_VERIFY # don't execute immediately upon history expansion
# background commands
setopt NO_BG_NICE # don't run background commands at a lower priority
setopt NO_NOTIFY # don't notify us of background commands finishing
setopt NO_HUP # don't kill background commands if the spawning shell is exiting
# functions
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
# matches case insensitive for lowercase
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# pasting with tabs doesn't perform completion
# zstyle ':completion:*' insert-tab pending
# menu-driven auto completion
# zstyle ':completion:*' menu select
# initialize our completion
autoload -Uz bashcompinit && bashcompinit
autoload -Uz compinit && compinit
# shellcheck source=.zcompletions
. "$HOME/.zcompletions"
# shellcheck source=.zaliases
. "$HOME/.zaliases"
# initialize zinit
. "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
# plugins
# theme: purepower
zinit ice depth"1"
zinit ice src"powerlevel10k.zsh-theme"
zinit light romkatv/powerlevel10k
. ~/.purepower
# enforce vi-mode rather than zsh's default emacs mode
bindkey -v
KEYTIMEOUT=1
# set up fzf keybindings & completion
fzf_path="/usr/share/fzf"
if [ $(uname -s) = "Darwin" ]; then
fzf_path="/usr/local/opt/fzf/shell"
fi
. "$fzf_path/key-bindings.zsh"
if [ -f "$fzf_path/completion.zsh" ]; then
. "$fzf_path/completion.zsh"
fi