-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc.tmpl
83 lines (69 loc) · 2.04 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
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('{{ .chezmoi.homeDir }}/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "{{ .chezmoi.homeDir }}/miniconda3/etc/profile.d/conda.sh" ]; then
. "{{ .chezmoi.homeDir }}/miniconda3/etc/profile.d/conda.sh"
else
export PATH="{{ .chezmoi.homeDir }}/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# direnv
eval "$(direnv hook zsh)"
# ensure compatibility tmux <-> direnv
if [ -n "$TMUX" ] && [ -n "$DIRENV_DIR" ]; then
direnv reload
fi
# allow extended modifier keys in tmux
if [ -n "$TMUX" ]; then
precmd() { printf '\033[>4;1m' }
fi
# aliases
if [ -f ~/.aliases ]; then
. ~/.aliases
fi
# Save command history
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
# zsh-autosuggestions
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# this is the ctrl-enter binding
bindkey '3;5u' autosuggest-accept
# for some reason tmux swallows the 3
bindkey ';5u' autosuggest-accept
# fzf
eval "$(fzf --zsh)"
export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
_fzf_compgen_path() {
fd "$1"
}
_fzf_compgen_dir() {
fd --type=d "$1"
}
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf --preview 'tree -C {} | head -200' "$@" ;;
export|unset) fzf --preview "eval 'echo \$'{}" "$@" ;;
ssh) fzf --preview 'dig {}' "$@" ;;
*) fzf --preview 'bat -n --color=always {}' "$@" ;;
esac
}
# zoxide
eval "$(zoxide init zsh)"
# starship
eval "$(starship init zsh)"
# fzf-sesh
source ~/.local/share/fzf-sesh/bin/fzf-sesh
export PATH=$PATH:$HOME/.local/share/fzf-sesh/bin