-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
89 lines (70 loc) · 2.4 KB
/
zshrc
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
# homebrew
export HOMEBREW_PREFIX="/opt/homebrew";
export HOMEBREW_CELLAR="${HOMEBREW_PREFIX}/Cellar";
export HOMEBREW_REPOSITORY="${HOMEBREW_PREFIX}/Homebrew";
export HOMEBREW_NO_ENV_HINTS=1
PATH="${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:${PATH}";
# dotfile binaries
PATH="${HOME}/.bin:${PATH}"
# go
export GOPATH="${HOME}/.go"
PATH="${GOPATH}/bin:${PATH}"
# mise
eval "$(${HOMEBREW_PREFIX}/bin/mise activate zsh)"
# `git trust`
PATH=".git/safe/../../bin:${PATH}"
export FZF_DEFAULT_COMMAND="rg --files --hidden --no-ignore-vcs"
export FZF_CTRL_T_COMMAND="rg --files"
export RIPGREP_CONFIG_PATH=${HOME}/.ripgreprc
export EDITOR=nvim
export VISUAL=$EDITOR
export PAGER=less
export LESS='-F -i -R -S -w -X -z-4'
export RUBYOPT='-W:deprecated'
export -U PATH
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git*' unstagedstr "*"
zstyle ':vcs_info:git*' check-for-changes true
zstyle ':vcs_info:git*' formats "%b%u"
zstyle ':vcs_info:git*' actionformats "%b|%a"
autoload add-zsh-hook
add-zsh-hook precmd vcs_info
setopt prompt_subst
[[ $SSH_CONNECTION ]] && local remote='%F{red}${HOST:l}%f '
PROMPT="${remote}%{%}%~%{%f%} %F{white}❯%f "
RPROMPT='%{%F{242}%}${vcs_info_msg_0_}%{%f%}'
setopt hist_ignore_all_dups inc_append_history
HISTSIZE=10000
SAVEHIST=10000
# Prevent overwriting files with `>` operator
setopt noclobber
source "${HOMEBREW_PREFIX}/opt/fzf/shell/completion.zsh"
source "${HOMEBREW_PREFIX}/opt/fzf/shell/key-bindings.zsh"
source "${HOMEBREW_PREFIX}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
autoload -Uz compinit
compinit -C;
g() {
if [[ $# -gt 0 ]]; then
git "$@"
else
git status
fi
}
compdef g=git
bindkey "^A" beginning-of-line
bindkey "^E" end-of-line
bindkey '^b' backward-word
bindkey '^w' forward-word
export FZF_DEFAULT_OPTS="--color=bg+:#131313,bg:#131313,border:#9a9a9a,spinner:#c1c1c1,hl:#8abae1,fg:#9a9a9a,header:#fc6a5d,info:#ffffff,pointer:#fc6a5d,marker:#ffffff,fg+:#ffffff,prompt:#c1c1c1,hl+:#8abae1"
# Enable 1Password SSH agent
#
# Only set SSH_AUTH_SOCK for local sessions (SSH_TTY is unset); if SSH_TTY is set, assume that it's
# a remote session, and that SSH agent forwarding is active, so leave SSH_AUTH_SOCK alone
if [ -z "$SSH_TTY" ]; then
export SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock
fi
alias dev="cd ~/Developer"
alias t="$EDITOR ~/.notes/today.md"
alias vim="nvim"
alias dot="cd ~/.dotfiles"