-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
105 lines (88 loc) · 3.63 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
bindkey -e
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export EDITOR=nvim
export COLORTERM=truecolor
export PATH=$PATH:~/.bin:~/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:~/code/lua-language-server/bin:/opt/homebrew/bin
export PATH="/usr/local/opt/openssl/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
eval "$(mise activate zsh)"
eval "$(mise hook-env -s zsh)"
for zsh_file in ~/.zsh_completions/*.zsh; do
[[ -f $zsh_file ]] && source $zsh_file
done
{{ if eq .chezmoi.os "darwin" -}}
{{- include "zshrc.darwin" -}}
{{- else if eq .chezmoi.os "linux" -}}
{{- include "zshrc.linux" -}}
{{- end }}
zsh_plugins=${ZDOTDIR:-~}/.zsh_plugins
fpath+=(~/.zsh_completions)
fpath+=(~/.antidote/functions)
autoload -Uz antidote
if [[ ! ${zsh_plugins}.zsh -nt ${zsh_plugins} ]]; then
antidote bundle <${zsh_plugins} >|${zsh_plugins}.zsh
fi
autoload bashcompinit && bashcompinit
autoload -Uz compinit
compinit
ZSH_AUTOSUGGEST_STRATEGY=(completion)
ZSH_AUTOSUGGEST_MANUAL_REBIND=true
ZSH_AUTOSUGGEST_HISTORY_IGNORE="z *"
# move a lot of files, syntax: mmv (mmv *.c.orig orig/*.c)
autoload -Uz zmv
alias mmv='noglob zmv -W'
# local stuff
[ -f ~/.zshrc.local ] && source ~/.zshrc.local
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
[ "$HISTSIZE" -lt 50000 ] && HISTSIZE=50000
[ "$SAVEHIST" -lt 10000 ] && SAVEHIST=10000
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_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
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_FIND_NO_DUPS # Do not display a previously found event.
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
setopt HIST_NO_STORE # Don't store history commands
export _ZL_MATCH_MODE=1
alias j=z
alias v="nvim"
alias cat="bat"
alias ls="eza"
alias l="ls -la --icons=auto --git --no-permissions -o --group-directories-first"
alias m="mise"
alias mi="mise install"
alias mr="mise run --"
alias mu="mise use"
alias ch="chezmoi"
alias cha="chezmoi apply && source ~/.zshrc"
alias che="chezmoi edit"
alias chu="chezmoi update"
alias chsh="chezmoi edit ~/.zshrc && cha"
alias chmi="chezmoi edit ~/.config/mise/mise.toml"
alias chc="chezmoi edit-config && ch init"
alias pr="gh f -p"
alias is="iex -S mix phx.server"
export FZF_DEFAULT_COMMAND='rg --files --no-ignore-vcs --hidden'
export FZF_TMUX=1
export FZF_CTRL_R_OPTS="--preview-window=hidden"
export FZF_TMUX_OPTS="-p 75%,75%"
export FZF_PREVIEW_COMMAND="if [[ -d {} ]]; then eza --icons=always --git --level 2 --tree --color=always --group-directories-first {}; elif [[ -f {} ]]; then bat --style=full --color=always {}; fi"
export FZF_DEFAULT_OPTS="--border='rounded' --preview='$FZF_PREVIEW_COMMAND' --prompt='⌘ '"
bindkey '\e[19~' autosuggest-accept
function chpwd() {
tmux rename-window $(shrink_path -f)
}
source ~/.github_token
eval "$(hub alias -s)"
eval "$(~/.local/bin/mise activate zsh)"
MISE_ENV_FILE=.env
# Source your static plugins file.
source ${zsh_plugins}.zsh
# Load after oh-my-zsh keybindings are defined
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh