-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
84 lines (67 loc) · 2.54 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
# Path to your oh-my-zsh installation.
export ZSH=/Users/$(whoami)/.oh-my-zsh
ZSH_THEME="robbyrussell"
plugins=(git)
# User configuration
export GOPATH=$HOME/go
export PYTHONPATH=$HOME/Library/Python/2.7
export ANDROID_SDK=$HOME/Library/Android/sdk
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$GOPATH/bin:$PYTHONPATH/bin:$ANDROID_SDK/platform-tools:$ANDROID_SDK/emulator"
export GPG_TTY=$(tty)
source $ZSH/oh-my-zsh.sh
# setup fzf to use ripgrep to search files
export FZF_DEFAULT_COMMAND='rg --files --hidden'
# initialize fasd
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
eval "$(fasd --init auto)"
# setup fasd aliases
alias a='fasd -a' # any
alias s='fasd -si' # show / search / select
alias d='fasd -d' # directory
alias f='fasd -f' # file
alias sd='fasd -sid' # interactive directory selection
alias sf='fasd -sif' # interactive file selection
alias z='fasd_cd -d' # cd, same functionality as j in autojump
alias zz='fasd_cd -d -i' # cd with interactive selection
alias v='f -e vim' # quick opening files with vim
alias j='fasd_cd -d'
# easy weather command
alias weather='curl -4 http://wttr.in/New_York'
# initialize nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# automatically call nvm use if in directory with .nvmrc file
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
nvm use
fi
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
# alias for changes since last tag
# aka (g)it (l)og (l)ast changes since (t)ag
alias gllt='git log $(git describe --tags --abbrev=0)..HEAD --oneline'
# pnpm
export PNPM_HOME="/Users/nickdandakis/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# pnpm end
# lvim
export LVIM_HOME="/Users/nickdandakis/.local/bin"
export PATH="$LVIM_HOME:$PATH"
# lvim end
# bun completions
[ -s "/Users/nickdandakis/.bun/_bun" ] && source "/Users/nickdandakis/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"