owenrusk.dev

dotfiles

shell, editor, ssh.

git clone https://owenrusk.dev/dotfiles.git

dotfiles / zsh/zshrc -rw-r--r-- · 1535 bytes

 1 # no framework. it's a shell, not a lifestyle.
 2 
 3 HISTFILE=~/.zsh_history
 4 HISTSIZE=50000
 5 SAVEHIST=50000
 6 setopt share_history hist_ignore_dups hist_ignore_space hist_reduce_blanks extended_history
 7 setopt auto_cd interactive_comments no_beep
 8 unsetopt flow_control   # ctrl-s is for searching, not for freezing the terminal
 9 
10 bindkey -e
11 
12 # up and down search history for what's already typed
13 autoload -Uz up-line-or-beginning-search down-line-or-beginning-search edit-command-line
14 zle -N up-line-or-beginning-search
15 zle -N down-line-or-beginning-search
16 zle -N edit-command-line
17 bindkey '^[[A' up-line-or-beginning-search
18 bindkey '^[[B' down-line-or-beginning-search
19 bindkey '^x^e' edit-command-line
20 
21 autoload -Uz compinit
22 compinit -d ~/.cache/zcompdump
23 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
24 zstyle ':completion:*' menu select
25 
26 # host, directory, git branch, and the exit code when it isn't zero
27 autoload -Uz vcs_info add-zsh-hook
28 zstyle ':vcs_info:*' enable git
29 zstyle ':vcs_info:git:*' formats ' %b'
30 zstyle ':vcs_info:git:*' actionformats ' %b|%a'
31 add-zsh-hook precmd vcs_info
32 setopt prompt_subst
33 PROMPT='%F{8}%m%f %F{blue}%~%f%F{yellow}${vcs_info_msg_0_}%f %(?..%F{red}%?%f )%# '
34 
35 # ~/.zshrc is a link. follow it back here.
36 dots=${${(%):-%x}:A:h}
37 source $dots/aliases.zsh
38 source $dots/functions.zsh
39 
40 # fzf on ctrl-r, if this machine has it
41 for f in /usr/share/fzf/key-bindings.zsh /usr/share/doc/fzf/examples/key-bindings.zsh; do
42     [[ -r $f ]] && { source $f; break }
43 done
44 
45 [[ -r ~/.zshrc.local ]] && source ~/.zshrc.local