blob: d7a004c570d02f24c432a86c9d3fbfda6ed8ba5f (
plain)
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
|
#
# getchoo's zshrc
#
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
local cache_path="${XDG_CACHE_HOME}/zsh"
local zdump="${cache_path}/zdump"
local antidote_dir="${ZDOTDIR}/.antidote"
# bootstrap antidote
if [[ ! -e "$antidote_dir/antidote.zsh" ]]
then
git clone --depth=1 https://github.com/mattmc3/antidote.git "$antidote_dir"
fi
source "${antidote_dir}/antidote.zsh"
# zmodules
autoload -Uz bashcompinit compinit # colors promptinit
# colors
# promptinit; prompt walters
zmodload zsh/zutil
zmodload zsh/complist
zstyle ':completion::*' group-name ''
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu 'select'
zstyle ':completion:*' squeeze-slashes 'true'
zstyle ':completion::*' use-cache 'true'
zstyle ':completion::*' cache-path "$cache_path"
# load plugins
antidote load
## eval "$(zoxide init zsh)"
unset antidote_dir
# compile completion
bashcompinit
compinit -d "$zdump"
if [[ ! "${zdump}.zwc" -nt "$zdump" ]]
then
zcompile "$zdump"
fi
unset zdump
# options
unsetopt beep
unsetopt hist_beep
unsetopt ignore_braces
unsetopt list_beep
setopt always_to_end
setopt emacs
setopt hist_expire_dups_first
setopt hist_ignore_all_dups
setopt hist_ignore_dups
setopt hist_ignore_space
setopt inc_append_history
setopt prompt_subst
setopt share_history
# clear backbuffer with ctrl-l
function clear-screen-and-scrollback() {
echoti civis >"$TTY"
printf '%b' '\e[H\e[2J' >"$TTY"
zle .reset-prompt
zle -R
printf '%b' '\e[3J' >"$TTY"
echoti cnorm >"$TTY"
}
zle -N clear-screen-and-scrollback
bindkey '^L' clear-screen-and-scrollback
# enable history
HISTFILE="${XDG_STATE_HOME}/zsh/history"
HISTSIZE=100
SAVEHIST=1000
# source aliases
source "${XDG_CONFIG_HOME}/shell/aliases"
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
|