-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
98 lines (73 loc) · 2.13 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
90
91
92
93
94
95
96
97
98
ZSH=$HOME/.oh-my-zsh
export ZSH
plugins=(zsh-autosuggestions asdf)
ZSH_THEME="justinf"
DISABLE_AUTO_UPDATE="true"
source $ZSH/oh-my-zsh.sh
unsetopt correct_all
export GOPATH=$HOME/go
export GOPROXY=https://proxy.golang.org
PATH=$HOME/bin:$HOME/.local/bin:$HOME/.cargo/bin:$PATH:/bin:/usr/sbin:$GOPATH/bin
export PATH
export HOMEBREW_NO_AUTO_UPDATE=1
if which brew &> /dev/null; then
eval "$(brew shellenv)"
elif [[ -s "/opt/homebrew/bin/brew" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
alias srsync=rsync\ --rsh=ssh\ --partial\ --progress\ -r
alias jesc="perl -p -e 's/\\n/\\\\n/'"
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
if which rg &> /dev/null; then
unalias grep
alias grep="rg -uu -N"
fi
if which bat &> /dev/null; then
alias less=bat
export BAT_THEME=TwoDark
fi
if which lsd &> /dev/null; then
alias ls=lsd
fi
if which btm &> /dev/null; then
alias top='btm -b'
fi
if which terraform &> /dev/null; then
alias tf=terraform
fi
if which fzf &> /dev/null; then
if which fd &> /dev/null; then
alias fzd='fd -t d | fzf'
else
alias fzd='find -t d | fzf'
fi
function cdf() {
local query=$1
if [ -n "$query" ]; then
local queryflag="--query='${query}'"
fi
if which lsd &> /dev/null; then
local preview="lsd --color=always --icon=always {}"
else
local preview="ls {}"
fi
local template='cd "$(fzd --height=40%% --preview="%s" %s)"'
local command=$(printf "${template}" "${preview}" "${queryflag}")
eval "${command}"
}
fi
export EDITOR='nano -w'
if [ "$(uname)" = "Darwin" ]; then
alias subl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'
alias smerge='/Applications/Sublime\ Merge.app/Contents/SharedSupport/bin/smerge'
fi
if [ ! -z DISPLAY ]; then
if which subl &> /dev/null; then
export EDITOR='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --wait --new-window'
fi
fi
[[ -s "$HOME/.zshrc-private" ]] && source ~/.zshrc-private
if which starship &> /dev/null; then
eval "$(starship init zsh)"
fi