~idmyn/dotfiles

ref: 59b01acb356a7aeae22ee7c658db914f01f52c3b dotfiles/shell/.zshrc -rw-r--r-- 1.7 KiB
59b01acb — David Mynors Add stack to backup ignored dirs 3 months ago
                                                                                
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
source ~/.aliases
source ~/.secret-aliases

PROMPT="
%~
-> "

SHOW_K8S_PROMPT=0
function kp() {
  ((SHOW_K8S_PROMPT ^= 1)) # https://unix.stackexchange.com/a/364489
}
precmd() { [ "$SHOW_K8S_PROMPT" = 1 ] && RPROMPT="$(~/.bin/kubesummary)" || RPROMPT="" }

setopt autocd
function chpwd() {
    emulate -L zsh
    ls
}

# https://stackoverflow.com/a/8595614
function eb() {
  perl -MFile::Temp -MFile::Copy -e \
  'copy *STDIN, $file = File::Temp->new; system "emacsclient", $file';
}

zstyle ':completion:*' menu select # prettier tab completion

setopt BANG_HIST # Treat the '!' character specially during expansion
setopt SHARE_HISTORY # append to history after each command
setopt HIST_IGNORE_ALL_DUPS
HISTSIZE=10000
SAVEHIST=10000

source ~/.zinit/bin/zinit.zsh

zinit ice wait lucid
zinit light skywind3000/z.lua
export _ZL_MATCH_MODE=1
export _ZL_FZF_FLAG="+s"
alias zi="z -I"
alias zh='z -I -t .'
alias b='z -b'

zinit ice wait lucid
zinit light zsh-users/zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
zle -N history-substring-search-up
zle -N history-substring-search-down

if [ -d "$HOME/.asdf" ]; then
  zinit ice wait lucid
  zinit light asdf-vm/asdf
fi

zinit as"program" make'!' atclone'./direnv hook zsh > zhook.zsh' \
    atpull'%atclone' pick"direnv" src"zhook.zsh" for \
        direnv/direnv

zinit light-mode for \
  id-as'fzf/completion' https://github.com/junegunn/fzf/blob/master/shell/completion.zsh \
  id-as'fzf/key-bindings' https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh
export FZF_DEFAULT_COMMAND='fd --type f'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

zinit wait lucid atload"zicompinit; zicdreplay" blockf for \
    zsh-users/zsh-completions