-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc
More file actions
100 lines (79 loc) · 3.01 KB
/
dot_zshrc
File metadata and controls
100 lines (79 loc) · 3.01 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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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
#############
# General Configuration
#############
export GITHUB_USERID="ca-scribner"
export VISUAL="subl --wait"
export EDITOR="$VISUAL"
export CODE_ROOT="$HOME/code"
# Add local bin
export PATH="$HOME/.local/bin:$PATH"
# Load shared aliases with bash
source $HOME/.aliases
# usually I just go to ~/code anyway, but I don't want to if I'm opening a terminal in a specific (non HOME place)
if [[ "$PWD" == "$HOME" ]]; then
if [[ -d ~/code ]]; then
cd ~/code
fi
fi
#############
# Bindings
#############
# [Ctrl-RightArrow] - move forward one word
bindkey '^[[1;5C' forward-word
# [Ctrl-LeftArrow] - move backward one word
bindkey '^[[1;5D' backward-word
#############
# zsh plugins and prompts
#############
# Enable zsh-syntax-highlighting plugin
source $HOME/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Enable zsh-autosuggestions plugin
source $HOME/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# Powerlevel10k prompt
source ~/.config/zsh/themes/powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.config/zsh/themes/.p10k.zsh.
[[ ! -f ~/.config/zsh/themes/.p10k.zsh ]] || source ~/.config/zsh/themes/.p10k.zsh
#############
# Application configuration
#############
# Kubernetes
export KUBE_EDITOR='subl -n -w'
# TODO: Add kubectl auto completes to shell: `echo "[[ $commands[kubectl] ]] && source <(kubectl completion zsh)" >> ~/.zshrc`
# Add Go and its bins
export PATH="$PATH:/usr/local/go/bin"
export PATH="$PATH:$(go env GOPATH)/bin"
# autocomplete for fx
source <(fx --comp zsh)
# TODO: Do I need this?
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
# pasteinit() {
# OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
# zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
# }
# pastefinish() {
# zle -N self-insert $OLD_SELF_INSERT
# }
# zstyle :bracketed-paste-magic paste-init pasteinit
# zstyle :bracketed-paste-magic paste-finish pastefinish
### Fix slowness of pastes
# TODO: did I have a better way than this to avoid using system python?
# Activate global python venv so we don't mess with system, but still have something global
source ~/.global_venv/bin/activate
# eza autocompletions
export FPATH="$HOME/.local/src/completions/zsh:$FPATH"
# Set up fzf key bindings and fuzzy completion
if command -v fzf > /dev/null 2>&1; then
source <(fzf --zsh)
fi
# Set up atuin
# Keep this below `fzf` setup so atuin owns the ctrl+R binding
. "$HOME/.atuin/bin/env"
eval "$(atuin init zsh)"
# Load chainguard-specific extras
[[ ! -f $HOME/.zsh_chainguard ]] || source $HOME/.zsh_chainguard