-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
84 lines (71 loc) · 2.37 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
##############################
# omz init/config #
##############################
export ZSH="$HOME/.oh-my-zsh"
ZSH_CUSTOM="$HOME/.config/zsh"
zstyle ':omz:update' mode auto # update automatically without asking
COMPLETION_WAITING_DOTS="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
HIST_STAMPS="yyyy-mm-dd"
# early source of helper functions
source "${ZSH_CUSTOM}/functions.zsh"
##############################
# always-on config #
##############################
export LANG=en_US.UTF-8
export EDITOR=nvim
export LESS='--tabs=4 --no-init --LONG-PROMPT --ignore-case --quit-if-one-screen --RAW-CONTROL-CHARS'
TIMEFMT=$'real\t%E\nuser\t%U\nsys\t%S'
ZSH_THEME='bjs'
plugins=(sudo ssh-agent vi-mode safe-paste)
##############################
# OS-based plugins #
##############################
case "$(osfamily)" in
darwin)
eval "$(/opt/homebrew/bin/brew shellenv)"
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
plugins+=(brew macos gnu-utils)
;;
debian)
plugins+=(debian systemd)
;;
arch)
plugins+=(archlinux systemd)
;;
esac
##############################
# conditional plugins #
##############################
plugin_if_command code vscode
plugin_if_command direnv direnv
plugin_if_command docker docker docker-compose
plugin_if_command dotnet dotnet
plugin_if_command fzf fzf
plugin_if_command git gitfast
plugin_if_command go golang
plugin_if_command kubectl kubectl kube-ps1
plugin_if_command npm npm
plugin_if_command poetry poetry
plugin_if_command rustup rust
plugin_if_command terraform terraform
plugin_if_command tmux tmux
plugin_if_command zoxide zoxide
ZSH_TMUX_AUTOSTART='true' # auto start when launching shell
ZSH_TMUX_AUTOQUIT='false' # don't close terminal if tmux is closed
##############################
# conditional sources #
##############################
test -d "${HOME}/.local/bin" && export PATH="${HOME}/.local/bin:$PATH"
test -d "${HOME}/go/bin" && export PATH="$PATH:${HOME}/go/bin"
source_if_exists "${HOME}/.cargo/env"
source_if_exists "${HOME}/.zshrc.local"
# dedupe path
typeset -U path cdpath fpath manpath
source "$ZSH/oh-my-zsh.sh"
if (( $+commands[starship] )); then
eval "$(starship init zsh)"
fi
if (( $+commands[atuin] )); then
eval "$(atuin init zsh --disable-up-arrow)"
fi