-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
116 lines (85 loc) · 2.74 KB
/
.zshrc
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
# Disable username in prompt
export DEFAULT_USER=$USER
GPG_TTY=$(tty)
export GPG_TTY
# oh-my-zsh
if [ -d $HOME/.oh-my-zsh ]; then
export ZSH=$HOME/.oh-my-zsh
export ZSH_COMPDUMP=$ZSH/cache/.zcompdump-$HOST
export PYTHON_AUTO_VRUN=true
export PYTHON_VENV_NAME=".venv"
HIST_STAMPS="yyyy-mm-dd"
ZSH_THEME="agnoster"
plugins=(git zsh-autosuggestions python virtualenv)
source $ZSH/oh-my-zsh.sh
else
mkdir $HOME/.oh-my-zsh
git clone https://github.com/ohmyzsh/ohmyzsh.git $HOME/.oh-my-zsh
git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions
echo ""
echo "Restart zsh to load oh-my-zsh"
fi
############################################
# WSL Specific Options
# Duplicate panel in the current path in windows terminal
if [ -f "$(command -v wslpath)" ]; then
keep_current_path() {
printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"
}
precmd_functions+=(keep_current_path)
fi
############################################
# OSX Specific Options
# brew
if [ -x /opt/homebrew/bin/brew ]; then
# Disable homebrew auto updating
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_UPGRADE=1
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# iterm2
[ -e $HOME/.iterm2_shell_integration.zsh ] && source $HOME/.iterm2_shell_integration.zsh
############################################
# Linux Specific Options
# linuxbrew
if [ -d /home/linuxbrew/.linuxbrew ]; then
# Disable homebrew auto updating
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALL_UPGRADE=1
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
# snap
[ -f /etc/profile.d/apps-bin-path.sh ] && source /etc/profile.d/apps-bin-path.sh
############################################
[ -d $HOME/.local/bin ] && export PATH="$HOME/.local/bin:$PATH"
[ -d $HOME/bin ] && export PATH="$HOME/bin:$PATH"
[ -f $HOME/.zshrc.local ] && source $HOME/.zshrc.local
source $HOME/dotfiles/aliases.sh
############################################
# dircolors
if [ -f "$(command -v dircolors)" ]; then
eval "$(dircolors -b $HOME/dotfiles/.config/dircolors/config)" || eval "$(dircolors -b)"
fi
# fzf
[ -f "$(command -v fzf)" ] && source <(fzf --zsh)
# zoxide
[ -f "$(command -v zoxide)" ] && eval "$(zoxide init zsh)"
# fnm
if [ -d $HOME/.local/share/fnm ]; then
export PATH="$HOME/.local/share/fnm:$PATH"
eval "$(fnm env --use-on-cd --shell zsh)"
eval "$(fnm completions --shell zsh)"
fi
# pnpm
[ -f $HOME/.pnpm-tab-completion.sh ] && source $HOME/.pnpm-tab-completion.sh
# bun
if [ -f $HOME/.bun/_bun ]; then
source $HOME/.bun/_bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
fi
# cargo
if [ -d $HOME/.cargo ]; then;
. "$HOME/.cargo/env"
fi
############################################