-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
64 lines (47 loc) · 1.34 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
# brew
if [ -d /opt/homebrew ]; then
BREW_PREFIX=/opt/homebrew
else
BREW_PREFIX=/usr/local
fi
eval "$($BREW_PREFIX/bin/brew shellenv)"
# paths
[[ :$PATH: == *:$HOME/bin:* ]] || PATH=$HOME/bin:$PATH
# zsh-completions
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -U compinit && compinit
# direnv
eval "$(direnv hook zsh)"
# pyenv
export PATH="$HOME/.pyenv/shims:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
eval "$(pyenv init -)"
# fzf
export FZF_DEFAULT_COMMAND="fd --type f"
# aliases
alias fzf="fzf --preview 'bat --color=always --style=numbers --line-range=:250 {}'"
alias vimf='vim -o "$(fzf)"'
alias fda="fd --hidden --exclude .git --exclude .direnv --exclude __pycache__ --type f"
alias ls="eza"
alias du="du -A"
# git
function git-open() { (
set -e
git remote >>/dev/null
remote=${1:-origin}
url=$(git config remote.$remote.url | sed "s/git@\(.*\):\(.*\).git/https:\/\/\1\/\2/")
echo "git: opening $remote $url"
open $url
); }
# gcloud
if [ -d "$HOME/google-cloud-sdk" ]; then
export PATH="$HOME/google-cloud-sdk/bin:$PATH"
fi
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$BREW_PREFIX/opt/nvm/nvm.sh" ] && . "$BREW_PREFIX/opt/nvm/nvm.sh"
[ -s "$BREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && . "$BREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm"
# llvm
export PATH="$BREW_PREFIX/opt/llvm/bin:$PATH"