-
Notifications
You must be signed in to change notification settings - Fork 0
/
_zshrc
120 lines (100 loc) · 3.17 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# Path to development folder
export DEV=$HOME/Dev
export DEPLOY_USER="sebastienbeal"
export DEFAULT_USER="sebastienbeal"
# Locales
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# GO
export GOPATH=$DEV/go
export GOROOT=/usr/local/opt/go/libexec
# Set the list of directories that Zsh searches for programs.
path=(
/usr/local/{bin,sbin}
/usr/local/share/npm/bin
$GOPATH/bin
$GOROOT/bin
$HOME/.cabal/bin
/Applications/Postgres.app/Contents/Versions/13/{bin,lib}
/usr/local/heroku/bin
$HOME/.pyenv/{bin,shims}
$HOME/.cask/bin
$path
)
# OSX
alias fixow='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user;killall Finder;echo "Open With has been rebuilt, Finder will relaunch"'
# Tmux
alias tma='tmux attach -d -t'
alias tmn='tmux new -s $(basename $(pwd))'
alias tml='tmux list-sessions'
# Emacs
alias em="emacsclient -n"
export EDITOR="emacsclient -n"
export SHELL="/bin/zsh"
# Bower
alias bower='noglob bower'
# Postgres
export PGHOST=/tmp
# Python
export WORKON_HOME=$DEV
export VIRTUALENVWRAPPER_LOG_DIR="logs"
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV='true'
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include"
# pyenv virtualenvwrapper_lazy
export PIP_VIRTUALENV_BASE=$WORKON_HOME
# Node.js / Io.js
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
# iTerm2 window/tab color commands
# Requires iTerm2 >= Build 1.0.0.20110804
# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
}
tab-reset() {
echo -ne "\033]6;1;bg;*;default\a"
}
# Change the color of the tab when using SSH
# reset the color after the connection closes
color-ssh() {
if [[ -n "$ITERM_SESSION_ID" ]]; then
trap "tab-reset" INT EXIT
if [[ "$*" =~ "production|ec2-.*compute-1" ]]; then
tab-color 255 0 0
else
tab-color 0 255 0
fi
fi
ssh $*
}
# compdef _ssh color-ssh=ssh
# alias ssh=color-ssh
_neofetch() {
if hash neofetch 2>/dev/null; then
neofetch
else
echo -ne "$ brew install neofetch"
fi
}
_neofetch
# curl -4 http://wttr.in/Tokyo
# Cheat
export CHEATCOLORS=true
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh