-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
90 lines (73 loc) · 2.43 KB
/
dot_zshrc.tmpl
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
# Enable colors and change prompt:
autoload -U colors && colors
# Basic auto/tab complete:
fpath=($HOME/.config/zsh/completions $fpath)
autoload -Uz compinit
zmodload zsh/complist
compinit
# can't get caching to work
#typeset -i USE_CACHE
#(( $+commands[compaudit] && $+commands[compinit] )) && compaudit | read -ra USE_CACHE
#if (( USE_CACHE )); then
# compinit
#else
# compinit -C
#fi
# Set completion style
zstyle ':completion:*' menu select
# Include hidden files in completions
_comp_options+=(globdots)
# History configuration
source $HOME/.config/zsh/history.zsh
# Functions
source $HOME/.config/zsh/functions.zsh
# vi mode
bindkey -v
export KEYTIMEOUT=10
bindkey "^R" history-incremental-search-backward
bindkey '^[[3~' delete-char
# Use vim keys in tab complete menu:
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -v '^?' backward-delete-char
# Change cursor shape for different vi modes.
zle -N zle-keymap-select
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
# Edit line in vim with ctrl-e:
autoload edit-command-line; zle -N edit-command-line
bindkey '^e' edit-command-line
# Aliases
source $HOME/.config/zsh/aliases.zsh
# Environment Variables
export GEM_HOME="$HOME/.local/gems"
export PATH=/usr/local/go/bin:$PATH
export PATH="$GEM_HOME/bin:$PATH"
export PATH=$HOME/.local/bin:$PATH
{{- if and (eq .chezmoi.os "linux") (.chezmoi.kernel.osrelease | lower | contains "microsoft") }}
export PATH="/mnt/c/Windows/System32:$PATH"
{{- end }}
export VISUAL=nvim
export EDITOR="$VISUAL"
export DOCKER_BUILDKIT=1
# https://github.com/lukechilds/zsh-nvm
export NVM_COMPLETION=true
export NVM_LAZY_LOAD=true
export NVM_LAZY_LOAD_EXTRA_COMMANDS=("nvim")
# Other Zsh scripts
source $HOME/.local/share/zsh-nvm/zsh-nvm.plugin.zsh
source $HOME/.local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
{{- if and (eq .chezmoi.os "linux") (not (.chezmoi.kernel.osrelease | lower | contains "microsoft")) }}
source $HOME/.config/zsh/openvpn3.zsh
{{- end }}
# Some completions are broken and need to be sourced manually
. $HOME/.config/zsh/completions/_delta
. $HOME/.config/zsh/completions/_grm
# Atuin: https://github.com/atuinsh/atuin
eval "$(atuin init zsh --disable-up-arrow)"
# Zoxide: https://github.com/ajeetdsouza/zoxide
eval "$(zoxide init zsh)"
# Prompt
eval "$(starship init zsh)"