-
Notifications
You must be signed in to change notification settings - Fork 5
/
zshrc
executable file
·73 lines (60 loc) · 2.11 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
# instantOS zshrc
[ -z "$NOTMUX" ] && [ -z "$TMUX" ] && ! [ "$TERM_PROGRAM" = "vscode" ] && command -v tmux &> /dev/null && exec tmux && exit
# TODO: new colorscheme
export FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS'
--color=dark
--color=fg:-1,bg:-1,hl:#CE50DD,fg+:#ffffff,bg+:#626A7E,hl+:#E0527E
--color=info:#4BEC90,prompt:#6BE5E7,pointer:#E7766B,marker:#CFCD63,spinner:#5293E1,header:#579CEF
'
setopt promptsubst
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory
autoload -Uz compinit
compinit
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_USE_ASYNC="true"
bindkey -e
zhome=${ZDOTDIR:-$HOME}
isinstantos() {
command -v pacman &> /dev/null && \
command -v instantwm &> /dev/null && \
command -v instantmenu &> /dev/null
# TODO parse etc stuff
}
install_antidote_plugins() {
echo "loading plugin bundle"
[ -e "$HOME/.cache/zsh" ] || mkdir -p "$HOME/.cache/zsh"
BUNDLEFILE="${BUNDLEFILE:-/usr/share/instantshell/bundle.txt}"
# clone antidote if necessary and generate a static plugin file
cloneantidote() {
ANTIDOTEURL=/usr/share/instantshell/antidote
[ -e "$ANTIDOTEURL" ] || ANTIDOTEURL=https://github.com/mattmc3/antidote.git
git clone --depth=1 "$ANTIDOTEURL" $zhome/.antidote
}
if [[ ! $zhome/.zsh_plugins.zsh -nt $zhome/.zsh_plugins.txt ]]; then
[[ -e $zhome/.antidote ]] || cloneantidote
[[ -e $zhome/.zsh_plugins.txt ]] || touch $zhome/.zsh_plugins.txt
(
source $zhome/.antidote/antidote.zsh
BUNDLESTUFF=$(cat "$BUNDLEFILE")
if ! isinstantos
then
BUNDLESTUFF="$(grep -v instantos <<<"$BUNDLESTUFF")"
fi
antidote bundle <<<"$BUNDLESTUFF" >$zhome/.zsh_plugins.zsh
)
fi
}
alias iantidote="source $zhome/.antidote/antidote.zsh"
if ! [ -e $zhome/.zsh_plugins.zsh ]; then
install_antidote_plugins
fi
source $zhome/.zsh_plugins.zsh
export STARSHIP_CONFIG=/usr/share/instantshell/starship.toml
eval "$(starship init zsh)"
export LESS='-R --use-color -Dd+r$Du+b'
alias ls='ls --color=auto'
alias vi=nvim
alias vim=nvim