Repository navigation
Expand file tree
/
Copy path.zshrc
More file actions
156 lines (127 loc) · 4.1 KB
/
Copy path.zshrc
File metadata and controls
156 lines (127 loc) · 4.1 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Set History and allow dotfiles
setopt histignorealldups sharehistory globdots
# Quality of life options
setopt autocd # Change directory by typing its name
# setopt correct # Command correction suggestions
setopt no_beep # Disable terminal bell
# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
HISTSIZE=1000
SAVEHIST=1000
HISTFILE=~/.zsh_history
export HISTIGNORE="&:vault*"
fpath+=~/.zfunc
# Use modern completion system
autoload -Uz compinit
compinit
# Default editor
export EDITOR=nvim
# Handling of Paths
# Add $HOME/bin and $HOME/.local/bin to PATH if not already present
case ":$PATH:" in
*:"$HOME/bin":*) ;;
*) export PATH="$HOME/bin:$PATH" ;;
esac
case ":$PATH:" in
*:"$HOME/.local/bin":*) ;;
*) export PATH="$HOME/.local/bin:$PATH" ;;
esac
# GO
export GOPATH=${HOME}/go
export PATH="/usr/local/go/bin:${GOPATH}/bin:$PATH"
# PHP Composer
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
# Deno
if [ -d "$HOME/.deno" ]; then
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
fi
if [ -d "$HOME/.local/share/fzf-tab" ]; then
. "$HOME/.local/share/fzf-tab/fzf-tab.plugin.zsh"
# disable sort when completing `git checkout`
zstyle ':completion:*:git-checkout:*' sort false
# set descriptions format to enable group support
# NOTE: don't use escape sequences here, fzf-tab will ignore them
zstyle ':completion:*:descriptions' format '[%d]'
# set list-colors to enable filename colorizing
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# force zsh not to show completion menu, which allows fzf-tab to capture the unambiguous prefix
zstyle ':completion:*' menu no
# preview directory's content with eza when completing cd
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
# switch group using `<` and `>`
zstyle ':fzf-tab:*' switch-group '<' '>'
fi
# [[ -f "$HOME/.bash-preexec.sh" ]] && source "$HOME/.bash-preexec.sh"
# PHP
if command -v php &>/dev/null; then
export HOST_HAS_PHP=1
else
export HOST_HAS_PHP=0
fi
if [ -f /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then
. "/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
bindkey '^ ' autosuggest-accept
fi
if [ -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
. "/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
fi
# Cargo environement
if [ -f "$HOME/.cargo/env" ]; then
. "$HOME/.cargo/env"
fi
# Programs for multiple versions
# pyenv - Python
if [ -d "$HOME/.pyenv" ]; then
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export GIT_INTERNAL_GETTEXT_TEST_FALLBACKS=1
fi
# jenv - Java
if command -v jenv &>/dev/null; then
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
fi
# Nvim
if [ -d "$HOME/.local/share/bob" ]; then
export PATH="$HOME/.local/share/bob/nvim-bin:$PATH"
fi
# Extra vars
if test -n "$ZSH_VERSION"; then
export MYSHELL="zsh"
export HOSTNAME=$(hostname)
else
export MYSHELL="bash"
fi
# External files: aliases and functions
if [ -f "$HOME/.secrets.sh" ]; then
. "$HOME/.secrets.sh"
fi
if [ -f "$HOME/.bash_aliases" ]; then
. "$HOME/.bash_aliases"
fi
if [ -f "$HOME/.machine_aliases" ]; then
. "$HOME/.machine_aliases"
fi
if [ -f "$HOME/.shell_functions.sh" ]; then
. "$HOME/.shell_functions.sh"
fi
if command -v pixi &>/dev/null; then
export PATH="$HOME/.pixi/bin:$PATH"
fi
if command -v micromamba &>/dev/null; then
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'micromamba shell init' !!
export MAMBA_EXE="$HOME/bin/micromamba";
export MAMBA_ROOT_PREFIX="$HOME/.local/share/mamba";
__mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --root-prefix \"$MAMBA_ROOT_PREFIX\" 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<
fi
if command -v wt >/dev/null 2>&1; then eval "$(command wt config shell init zsh)"; fi