-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
76 lines (61 loc) · 2 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
source ~/.zshenv
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%}'
source "${HOMEBREW_PREFIX}/opt/fzf/shell/completion.zsh"
source "${HOMEBREW_PREFIX}/opt/fzf/shell/key-bindings.zsh"
fpath=(
$HOMEBREW_PREFIX/share/zsh/site-functions
$fpath
)
autoload -Uz compinit
if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
compinit;
else
compinit -C;
fi;
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
bindkey '^[[3~' delete-char
setopt hist_ignore_all_dups inc_append_history
HISTFILE=~/.zhistory
HISTSIZE=10000
SAVEHIST=10000
source "${HOMEBREW_PREFIX}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
# Prevent overwriting files with `>` operator
setopt noclobber
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 l="ls -Alhp"
alias mkdir="mkdir -p"
alias dev="cd ~/Developer"
alias web="cd ~/Developer/web"
alias t="$EDITOR ~/.notes/today.md"
alias vim="nvim"
alias dot="cd ~/.dotfiles"
alias batt="pmset -g batt | rg -o --pcre2 '([0-9]+\%).*' | cut -f3 -d' '"