blob: e63eed6bfc1578f2fa3338fd932335777ad1764e (
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
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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
#
# getchoo's zshrc
#
# plugins :)
if ! [[ -e ${ZDOTDIR:-~}/.antidote ]]; then
git clone https://github.com/mattmc3/antidote.git ${ZDOTDIR:-~}/.antidote
fi
# source antidote and load plugins from `${ZDOTDIR:-~}/.zsh_plugins.txt`
zhome=${ZDOTDIR:-$HOME}
if [[ ! $zhome/.zsh_plugins.zsh -nt $zhome/.zsh_plugins.txt ]]; then
[[ -e $zhome/.antidote ]] \
|| git clone --depth=1 https://github.com/mattmc3/antidote.git $zhome/.antidote
[[ -e $zhome/.zsh_plugins.txt ]] || touch $zhome/.zsh_plugins.txt
(
source $zhome/.antidote/antidote.zsh
antidote bundle <$zhome/.zsh_plugins.txt >$zhome/.zsh_plugins.zsh
)
fi
autoload -Uz $zhome/.antidote/functions/antidote
source $zhome/.zsh_plugins.zsh
unset zhome
# zmodules
autoload -U compinit #promptinit
zmodload zsh/complist
zstyle ':completion:*' menu select reshash true
compinit
#promptinit
#prompt walters
# options
setopt append_history
setopt inc_append_history
setopt share_history
# binds
bindkey -e
## 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=200
SAVEHIST=1000
# aliases
alias ls='exa'
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh.
[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh
|