-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
127 lines (104 loc) · 3.96 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
{{- if eq .chezmoi.os "linux" }}
source /usr/share/zsh/scripts/zplug/init.zsh
{{- else if eq .chezmoi.os "darwin" }}
source /opt/homebrew/opt/zplug/init.zsh
{{- end }}
export EDITOR=nvim
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
zplug "mafredri/zsh-async", from:github
zplug "chrissicool/zsh-256color"
zplug "ohmyzsh/ohmyzsh", use:"lib/key-bindings.zsh"
zplug "ohmyzsh/ohmyzsh", use:"lib/clipboard.zsh"
zplug "ohmyzsh/ohmyzsh", use:"lib/completion.zsh"
zplug "plugins/aws", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/terraform", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "plugins/docker", from:oh-my-zsh
zplug "Aloxaf/fzf-tab"
if [[ $OSTYPE = (linux)* ]]; then
zplug "plugins/archlinux", from:oh-my-zsh, if:"(( $+commands[pacman] ))"
fi
if [[ $OSTYPE = (darwin)* ]]; then
zplug "lib/clipboard", from:oh-my-zsh
zplug "plugins/osx", from:oh-my-zsh
zplug "plugins/brew", from:oh-my-zsh, if:"(( $+commands[brew] ))"
fi
zplug "hlissner/zsh-autopair", defer:2
zplug 'zsh-users/zsh-autosuggestions'
zplug 'zsh-users/zsh-syntax-highlighting', defer:2
zplug 'zsh-users/zsh-history-substring-search', defer:3
zplug 'zsh-users/zsh-completions', depth:1
zplug "MichaelAquilina/zsh-you-should-use"
zplug "junegunn/fzf", use:shell/key-bindings.zsh
autoload -U compinit; compinit
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
else
echo
fi
fi
zplug load
EDITOR=nvim
HISTFILE=~/.zsh_history
HISTSIZE=1000000
SAVEHIST=1000000
HISTORY_IGNORE="(ls|cd|pwd|exit|cd)*"
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt APPEND_HISTORY # append to history file (Default)
setopt HIST_NO_STORE # Don't store history commands
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks from each command line being added to the history.
fpath+=~/.zfunc
{{- if eq .chezmoi.os "linux" }}
source /usr/share/fzf/completion.zsh
source /usr/share/fzf/key-bindings.zsh
{{- end }}
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
zstyle ':completion:*:git-checkout:*' sort false
zstyle ':completion:*:descriptions' format '[%d]'
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
zstyle ':fzf-tab:*' switch-group '<' '>'
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
export PATH="${PATH}:${HOME}/.krew/bin:${HOME}/.local/bin"
export FZF_TMUX_OPTS="-p"
export FZF_CTRL_R_OPTS="--reverse --preview 'echo {}' --preview-window down:30:hidden:wrap --bind '?:toggle-preview'"
eval "$(direnv hook zsh)"
eval "$(zoxide init zsh)"
eval "$(starship init zsh)"
eval "$(mise activate zsh)"
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
autoload -Uz compinit
compinit
fi
alias du="ncdu --color dark"
alias ls='eza --icons --git'
alias ll='eza -l --icons --git'
alias l='ll'
alias cd='z'
alias cat='bat'
alias df='duf'
alias k='kubectl'
alias kn='kubectl ns'
alias kx='kubectl ctx'
alias vim='nvim'
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh