summaryrefslogtreecommitdiffstats
path: root/zsh/.zshrc
blob: d6a42920dad274c60fecd78ea1002249b7d9b1dd (plain) (blame)
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
# language environments {{{
test -d "$HOME/.cargo/bin" && export PATH="$HOME/.cargo/bin:$PATH"
# }}}
# environment {{{
# not using .zshenv, because it runs before /etc/profile, and /etc/profile
# tends to hard-set $PATH and such
PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:$PATH"
export PATH
# shellcheck source=sh/.config/sh/env
[ -f "$HOME/.config/sh/env" ] && source "$HOME/.config/sh/env"
# }}}
# aliases {{{
# shellcheck source=sh/.config/sh/aliases
[ -f "$HOME/.config/sh/aliases" ] && source "$HOME/.config/sh/aliases"
# }}}
# completion {{{
# shellcheck disable=SC2206
fpath=( \
    "${HOME}/.config/zsh/local-completions/$(hostname)" \
    "${HOME}/.config/zsh/local-completions" \
    "${HOME}/.config/zsh/zsh-completions/src" \
    $fpath \
)
# shellcheck source=zsh/.zshcomplete
source ~/.zshcomplete
# }}}
# zsh configuration {{{
# shellcheck source=zsh/.zshinput
source ~/.zshinput
autoload -U colors
colors
setopt incappendhistory
setopt extendedhistory
setopt histignoredups
setopt noclobber
setopt nobeep
setopt completeinword
setopt correct
export HISTFILE=$HOME/.zsh_history
export HISTSIZE=1000000000
export SAVEHIST=1000000000
# shellcheck disable=SC2154
export SPROMPT="Correct ${fg[red]}%R$reset_color to ${fg[green]}%r$reset_color? [ynae] "
export KEYTIMEOUT=5
# plugins {{{
# zsh-syntax-highlighting {{{
# shellcheck disable=SC2154,SC2034
{
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
# shellcheck source=zsh/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# shellcheck disable=SC1094
source ~/.config/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=green'
ZSH_HIGHLIGHT_STYLES[alias]='fg=green'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=green'
ZSH_HIGHLIGHT_STYLES[function]='fg=green'
ZSH_HIGHLIGHT_STYLES[command]='fg=green'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=yellow'
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green'
ZSH_HIGHLIGHT_STYLES[path]='fg=blue,bold'
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=blue,underline'
ZSH_HIGHLIGHT_STYLES[path_approx]='underline'
ZSH_HIGHLIGHT_STYLES[globbing]='fg=magenta'
ZSH_HIGHLIGHT_STYLES[history-expansion]='none'
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=green'
ZSH_HIGHLIGHT_STYLES[assign]='fg=cyan'
}
# }}}
# zsh-autosuggestions {{{
# shellcheck source=zsh/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
# shellcheck disable=SC1094
source ~/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
# shellcheck disable=SC2034
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=black,bold'
# see https://github.com/zsh-users/zsh-autosuggestions/issues/619
unset ZSH_AUTOSUGGEST_USE_ASYNC
# }}}
# }}}
# prompt {{{
if type starship > /dev/null 2>&1; then
    eval "$(starship init zsh)"
fi
# }}}
# }}}
# fortune {{{
fortune -n600 -s ~/.local/share/fortune | grep -v -E "^$"
# }}}
# vim: fdm=marker