this repo has no description
1# Source zshenv again after macOS /etc/zprofile nukes PATH
2source ~/.zshenv
3
4# Stop here if this is e.g. cron or puma-dev
5[[ ! -v TERM ]] && return 0
6
7# Start every shell with a random my little horse ebooks
8if [[ $TERM_PROGRAM != "vscode" ]]; then
9 echo; $BREW_PREFIX/bin/fortune $BREW_PREFIX/share/games/fortunes/weird | ponysay -b unicode 2>/dev/null | pr -o 3 -t; echo
10fi
11
12# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
13# Initialization code that may require console input (password prompts, [y/n]
14# confirmations, etc.) must go above this block, everything else may go below.
15() { [[ -r $1 ]] && source $1 } ${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-$USERNAME.zsh
16
17# Load znap so everything else can be loaded in the background
18source ~/.zsh/znap/zsh-snap/znap.zsh
19
20# znap source marlonrichert/zsh-autocomplete
21znap source zsh-users/zsh-autosuggestions
22znap source zsh-users/zsh-syntax-highlighting
23# znap source softmoth/zsh-vim-mode
24znap source zsh-users/zsh-history-substring-search
25znap source scriptingosx/mac-zsh-completions
26znap source MichaelAquilina/zsh-you-should-use
27znap source mafredri/zsh-async
28
29if [[ -n $GHOSTTY_RESOURCES_DIR ]]; then
30 znap eval ghostty 'cat "$GHOSTTY_RESOURCES_DIR"/shell-integration/zsh/ghostty-integration'
31fi
32
33# switch edit mode back to emacs despite EDITOR being vim
34# this has to come before the znap evals so it can be partially overwritten
35bindkey -e
36
37# for some reason tmux loses forward delete bind
38bindkey "^[[3~" delete-char
39
40znap eval zoxide 'zoxide init zsh'
41znap eval nodenv 'nodenv init -'
42znap eval fzf 'fzf --zsh'
43znap eval atuin 'atuin init zsh --disable-up-arrow'
44znap eval ghcs 'gh copilot alias zsh'
45znap eval jj 'COMPLETE=zsh jj'
46znap eval rv 'rv shell init zsh'
47
48# bind the history substring search to up and down arrows
49bindkey '^[[A' history-substring-search-up
50bindkey '^[[B' history-substring-search-down
51
52# only match command starts on up and down
53HISTORY_SUBSTRING_SEARCH_PREFIXED=true
54HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND=(bold)
55
56znap fpath _kubectl 'kubectl completion zsh'
57znap fpath _rustup 'rustup completions zsh'
58znap fpath _cargo 'rustup completions zsh cargo'
59znap fpath _atuin 'atuin gen-completions --shell zsh'
60znap fpath _posh 'posh completion zsh'
61znap fpath _rv 'rv shell completions zsh'
62
63comppaths=(
64 ~/.zsh/functions
65 $BREW_PREFIX/share/zsh-completions
66 $BREW_PREFIX/share/zsh/site-functions
67)
68
69for comppath in $comppaths; do
70 fpath+=$comppath
71 autoload -U $comppath/*(:t)
72done
73
74for file in ~/.zsh/*.zsh; do
75 znap eval $file(:t) "cat $file"
76done
77
78# ctrl-] to jump to a repo
79zle -N fzf-src
80bindkey '^]' fzf-src
81
82# Make delete-by-word stop on punctuation like other editors
83WORDCHARS=""
84# Shared history across all shells, updated after every command
85HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
86
87export HISTSIZE=1000000000
88export SAVEHIST=$HISTSIZE
89setopt EXTENDED_HISTORY
90setopt SHARE_HISTORY
91setopt APPEND_HISTORY
92setopt INC_APPEND_HISTORY
93setopt HIST_FIND_NO_DUPS
94setopt HIST_REDUCE_BLANKS
95setopt HIST_IGNORE_SPACE
96setopt AUTO_CD
97setopt NO_CASE_GLOB
98setopt GLOB_COMPLETE
99setopt HIST_VERIFY
100
101# partial completion suggestions
102zstyle ':completion:*' list-suffixes
103zstyle ':completion:*' expand prefix suffix
104
105# case insensitive path-completion
106zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
107
108export EDITOR="$HOME/.bin/editor"
109export VISUAL="$HOME/.bin/visual"
110export PAGER="less" # page with less not more
111export BROWSER="open" # opens URLs in the default OS X browser
112export LESS="-XRF" # Fix less to not clear screen on exit, show color, exit if < 1 screen
113export CLICOLOR=true # ls with color
114export BAT_THEME="Solarized (dark)"
115export RI="-f ansi" # ri with color
116export FZF_DEFAULT_COMMAND="rg --files --sortr created"
117export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
118export KALEIDOSCOPE_DIR=$HOME/src/indirect/Kaleidoscope
119export KUBECONFIG=$KUBECONFIG:~/.kube/rubygems.config
120export HOMEBREW_NO_ENV_HINTS=1
121
122# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
123znap source romkatv/powerlevel10k
124[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh