-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc.lts
161 lines (123 loc) · 3.75 KB
/
.zshrc.lts
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
157
158
159
160
##
## This files contains the long term support, committed .zshrc content. Experimental content should go to .zshrc
## and be migrated here after baking into my workflow.
##
##
## Enter a tmux session called "main" if we're not already in
##
if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then
tmux new-session -t main
tmux kill-session -a
fi
##
## P10K instant prompt. Keep near top
##
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
##
## Paths and tooling configuration
##
# shell configuration
export LANG=en_US.UTF-8
export EDITOR='vim'
# eliminate escape key delay
KEYTIMEOUT=1
# glob dotfiles for tab completion
setopt globdots
# basic executables
export PATH="$HOME/bin:/usr/local/bin:$PATH"
# homebrew
export PATH="/opt/homebrew/bin:$PATH"
which brew &>/dev/null
if [[ $? -eq 0 ]]; then
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" # for brew shell completion
fi
# rust
source $HOME/.cargo/env
# cmake
export CMAKE_PREFIX_PATH=$HOME/.local
export CMAKE_MODULE_PATH=$HOME/.local
export PATH="$PATH:$CMAKE_MODULE_PATH/bin"
# go (managed by gvm)
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
export PATH="$PATH:$HOME/go/bin"
# julia (managed by juliaup)
export PATH="$PATH:$HOME/.juliaup/bin"
# GCloud SDK
# The next line updates PATH for the Google Cloud SDK.
if [ -f "$HOME/opt/google-cloud-sdk/path.zsh.inc" ]; then . "$HOME/opt/google-cloud-sdk/path.zsh.inc"; fi
# The next line enables shell command completion for gcloud.
if [ -f "$HOME/opt/google-cloud-sdk/completion.zsh.inc" ]; then . "$HOME/opt/google-cloud-sdk/completion.zsh.inc"; fi
# broot
source "$HOME/.config/broot/launcher/bash/br"
# GPG signing
export GPG_TTY=$(tty)
# conda
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$($HOME/conda/bin/conda 'shell.zsh' 'hook')"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/conda/etc/profile.d/conda.sh" ]; then
. "$HOME/conda/etc/profile.d/conda.sh"
else
export PATH="$HOME/conda/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# java (managed by sdkman)
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# pnpm
export PNPM_HOME="/Users/alexanderding/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# broot
source "$HOME/.config/broot/launcher/bash/br"
# zsh (keep near bottom)
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(
asdf
git
pip
zsh-autosuggestions
fast-syntax-highlighting
fzf
)
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
VI_MODE_SET_CURSOR=true
export FZF_DEFAULT_COMMAND="fd -L --type f --hidden --exclude .git"
autoload -U edit-command-line
zle -N edit-command-line
bindkey '\C-x\C-e' edit-command-line
source "$ZSH/oh-my-zsh.sh"
# oh-my-zsh sets a strange default of special-dirs being true
# this causes . and .. to be suggested during tab completion
# explicitly disabling here
zstyle ':completion:*' special-dirs false
# kubectl
source <(kubectl completion zsh)
##
## Aliases
##
alias ls='ls --color -a' # enable color and hidden files
alias timeout="gtimeout"
alias t="todo.sh"
alias up="cd .."
alias k="kubectl"
alias ctx="kubie ctx"
alias ens="kubie ns"
alias o="open -a"
# alias vim="nvim"
alias v="vim"
##
## Source p10k, keep near bottom
##
# set up direnv
# this needs to happen before p10k configure, since it prints
eval "$(direnv hook zsh)"
# To customize prompt, run `p10k configure` or edit $HOME/.p10k.zsh.
[[ ! -f "$HOME/.p10k.zsh" ]] || source "$HOME/.p10k.zsh"