-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
77 lines (62 loc) · 1.81 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
# brew
eval "$(/opt/homebrew/bin/brew shellenv 2>/dev/null)"
eval "$(~/.homebrew/bin/brew shellenv 2>/dev/null)"
export HOMEBREW_CASK_OPTS="--appdir=~/Applications"
# pipx
export PATH=$PATH:$HOME/.local/bin
# Go
export GOPATH=$HOME/Code/go
export PATH=$PATH:$GOPATH/bin
# Rust
export PATH="$HOME/.cargo/bin:$PATH"
# Locale
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
# Pager
export PAGER="less"
alias less="less -RS"
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='rg --hidden -l ""'
# Autocomplete
if type brew &>/dev/null
then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
autoload -Uz compinit
compinit
fi
# Autocomplete from bash
autoload -U +X bashcompinit && bashcompinit
# ls colors
export CLICOLOR=1
# Prompt
function _aws_profile() {
[[ -n $AWS_PROFILE ]] && echo ' ☋ '$AWS_PROFILE
}
function _git_branch_name() {
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}')
[[ -n $branch ]] && echo ' ↘ '$branch
}
function _kube_context() {
ctx=$(kubectl config current-context 2> /dev/null || true)
[[ -n $ctx ]] && echo ' ⏣ '$ctx
}
setopt PROMPT_SUBST
export PROMPT="%B%1~%b"
export PROMPT="${PROMPT}"'%B%F{white}$(_git_branch_name)%b%f'
export PROMPT="${PROMPT}"'%B%F{white}$(_kube_context)%b%f'
export PROMPT="${PROMPT}"'%B%F{white}$(_aws_profile)%b%f'
export PROMPT="${PROMPT}"$'\n'"%# "
# Nudes
[ -f ~/.zshrc.private ] && source ~/.zshrc.private
# Mojo
export MODULAR_HOME="/Users/admin/.modular"
export PATH="/Users/admin/.modular/pkg/packages.modular.com_mojo/bin:$PATH"
# Orbstack
export DOCKER_HOST=unix:///$HOME/.orbstack/run/docker.sock