-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
executable file
·142 lines (111 loc) · 3.66 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
# shellcheck shell=bash disable=SC2034
# Path to your oh-my-zsh configuration.
export ZSH="${HOME}/.oh-my-zsh"
# Set to the name theme to load. Change it if user is SSHing.
[[ -z "$SSH_CLIENT" ]] && DEFAULT_USER="damon"
COMPLETION_WAITING_DOTS=true
DISABLE_UNTRACKED_FILES_DIRTY=true
DISABLE_UPDATE_PROMPT=true
DISABLE_AUTO_UPDATE=true
ZSH_COMPDUMP="${HOME}/.zcompdump"
ZSH_CUSTOM="${DOTFILES}/zsh.custom"
# async suggestions
ZSH_AUTOSUGGEST_USE_ASYNC=1
# set to blank string for pure prompt
ZSH_THEME=""
function source_if_exists {
# shellcheck source=/dev/null
source "$1" 2>/dev/null || true
}
function source_dotfile {
# shellcheck source=/dev/null
source "${DOTFILES}/${1}"
}
# oh-my-zsh opts
DISABLE_CORRECTION=1
HIST_IGNORE_SPACE=1
HIST_STAMPS="yyyy-mm-dd"
fpath=( "${DOTFILES}/zfuncs" "${fpath[@]}" )
# Added explicit FPATH export
export FPATH="${HOMEBREW_PREFIX}/share/zsh/functions:$FPATH"
# Register functions for autoloading
autoload -Uz \
android-mirror \
brewfind \
bubu \
cheat \
fprev \
halp \
opstream \
man
alias cbubu='clear ; bubu'
alias resesh='reset ; bubu && exec "$SHELL"'
alias brinfo='brewfind'
# Add the `help` command
autoload -Uz \
run-help \
run-help-git \
run-help-ip \
run-help-openssl \
run-help-sudo \
run-help-svk
unalias run-help
alias help='run-help'
# shellcheck source=/dev/null
source "${ZSH}/oh-my-zsh.sh"
# zplug
source_dotfile ".zplugrc"
##
# zsh opts | http://zsh.sourceforge.net/Doc/Release/Options.html
##
## zsh opts > history
HISTSIZE=$(( 10 ** 7 )) # 10 million lines of history in file
SAVEHIST=$(( 10 ** 6 )) # 1 million lines of history in mem
setopt BANG_HIST # expand '!' in history
setopt EXTENDED_HISTORY # save timestamp and duration
setopt HIST_EXPIRE_DUPS_FIRST # rm dupes before unique cmds
setopt HIST_FCNTL_LOCK # use os locking of history file
setopt HIST_FIND_NO_DUPS # don't diplay dupes when searching
setopt HIST_IGNORE_DUPS # don't add cmds to history if dupes of previous
setopt HIST_IGNORE_SPACE # don't add cmds that start with a space
setopt HIST_NO_STORE # don't store the `history` command itself
setopt HIST_REDUCE_BLANKS # see doc
setopt HIST_VERIFY # show the history cmd without executing
setopt INC_APPEND_HISTORY # cmds are recorded in order of execution
setopt SHARE_HISTORY # see doc
# NOTE: This can be slow!
# setopt HIST_LEX_WORDS # correctly handle whitespace
## zsh opts > completion
setopt ALWAYS_TO_END # move cursor to end after completing word
setopt AUTO_LIST
setopt AUTO_MENU # use menu after pressing `tab` twice
setopt AUTO_PARAM_KEYS
setopt COMPLETE_IN_WORD
setopt LIST_TYPES
setopt NO_AUTO_NAME_DIRS # UNSET "~dir" aliasing
## zsh opts > changing directories
setopt AUTO_CD
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
## zsh opts > input/output
setopt INTERACTIVE_COMMENTS # allow comments in interactive shell
setopt NO_FLOW_CONTROL # UNSET
##
# /zsh opts
##
# less options
export LESS='-R --ignore-case --tabs=4'
# bat options | https://github.com/sharkdp/bat
export BAT_THEME="Dracula"
# fzf
source_dotfile ".fzfrc"
source_dotfile ".aliases"
source_dotfile "lib-includes"
source_if_exists "${HOME}/.zshrc.local"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
# shellcheck source=.p10k.zsh disable=SC1094
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh