-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathzshrc
More file actions
70 lines (60 loc) · 2.23 KB
/
zshrc
File metadata and controls
70 lines (60 loc) · 2.23 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
# Initialize Homebrew (hardcoded for Apple Silicon)
export HOMEBREW_PREFIX="/opt/homebrew"
export HOMEBREW_CELLAR="/opt/homebrew/Cellar"
export HOMEBREW_REPOSITORY="/opt/homebrew"
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$HOME/.local/bin:/usr/local/bin:/usr/local/sbin:$PATH"
export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:"
export INFOPATH="/opt/homebrew/share/info${INFOPATH+:$INFOPATH}"
export EDITOR="nvim"
# http://zsh.sourceforge.net/Doc/Release/Options.html
setopt AUTO_CD
setopt GLOB_COMPLETE
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt NO_CASE_GLOB
setopt SHARE_HISTORY
# @see http://zsh.sourceforge.net/Doc/Release/Parameters.html
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
# @see http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html
bindkey '^P' history-incremental-pattern-search-backward
bindkey '^N' history-incremental-pattern-search-forward
# @see http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html
# @see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
if [ -f /opt/homebrew/etc/bash_completion.d/git-prompt.sh ]; then
. /opt/homebrew/etc/bash_completion.d/git-prompt.sh
setopt PROMPT_SUBST
GIT_PS1_SHOWDIRTYSTATE="true"
PROMPT='%F{5}[%n]%f %F{4}%1~%f %F{6}$(__git_ps1 "[%s] ")%f%F{8}%#%f '
else
PROMPT='%F{5}[%n]%f %F{4}%1~%f %F{8}%#%f '
fi
# Handy stuff
alias ...="cd ../../"
alias ....="cd ../../../"
alias bake="caffeinate -i -d -t 3600"
alias cp="cp -i"
alias la="ls -lA"
alias ll="ls -l"
alias ls="ls -G"
alias mv="mv -i"
alias reload="source ~/.zshrc && cd ../ && cd -"
# case insensitive path-completion
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' \
'm:{[:lower:][:upper:]}={[:upper:][:lower:]} l:|=* r:|=*'
# partial completion suggestions
zstyle ':completion:*' list-suffixes
zstyle ':completion:*' expand prefix suffix
# Load zsh completion engine
autoload -Uz compinit && compinit
# pnpm
export PNPM_HOME="${ZDOTDIR:-$HOME}/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# Load local zshrc file if it exists
if [ -f "${ZDOTDIR:-$HOME}/.zshrc.local" ]; then
source "${ZDOTDIR:-$HOME}/.zshrc.local"
fi