-
Notifications
You must be signed in to change notification settings - Fork 0
/
_zshrc
108 lines (96 loc) · 3.36 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
export EDITOR=vim
bindkey -e # emacs mode shell
export BUNDLE_GEM__FURY__IO=hidden
export BUNDLE_ENTERPRISE__CONTRIBSYS__COM=hidden
export BUNDLE_NEXUS___PROXY__REPO__LOCAL__SFDC__NET=hidden
export GITHUB_PACKAGES_TOKEN=hidden
# th-components
export NPM_CERT_DIR="$HOME/ssl"
export NEXUS_USERNAME=hidden
export NEXUS_PASSWORD=hidden
export NEXUS_PASSWORD_B64=hidden
# C-x C-e edits command line
autoload -U edit-command-line
zle -N edit-command-line
bindkey '^xe' edit-command-line
bindkey '^x^e' edit-command-line
# only autocomplete on tab
setopt no_auto_menu
# allow comments
setopt interactivecomments
# C-u behaves like bash instead of clearing whole line
bindkey \^U backward-kill-line
# don't automatically run history commands
setopt hist_verify
# if directory name is entered without cd
setopt auto_cd
# preserve history when exiting shell
HISTFILE=~/.zsh/.zsh_history
SAVEHIST=5000
HISTSIZE=5000
# record history as they are typed, not at shell exit
# setopt inc_append_history
setopt share_history
setopt extended_history
# unsetopt extended_history
# do not store duplications
setopt hist_ignore_dups
# removes blank lines from history
setopt hist_reduce_blanks
# option-arrow keys
bindkey "^[[1;3C" forward-word
bindkey "^[[1;3D" backward-word
# Git info in prompt
function parse_git_dirty {
[[ $(git status --long 2> /dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e "/^[^\*]/d" -e "s/^\*\ \(.*\)/[\1$(parse_git_dirty)]/"
}
setopt prompt_subst
PROMPT='%{%F{cyan}%}$(parse_git_branch)%{%F{none}%}%1~$ '
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
export PATH="/opt/homebrew/opt/node@16/bin:$PATH"
# swagger-codegen path
export PATH="/opt/homebrew/opt/swagger-codegen@2/bin:$PATH"
# pyenv
export PATH="/Users/mike/.pyenv/shims:$PATH"
# PE
# export PATH="$HOME/.pollev/bin:$PATH"
export PATH="$HOME/.mix/escripts:$PATH"
if [ -f ~/.zsh_aliases ]; then
. ~/.zsh_aliases
fi
# git completion
if [ -f ~/.git_aliases.zsh ]; then
fpath=(~/.zsh $fpath)
autoload -Uz compinit && compinit
. ~/.git_aliases.zsh
fi
# export PYTHON=python3
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_DEFAULT_OPTS='--no-mouse'
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/opt/homebrew/opt/[email protected]"
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
export NVM_DIR="$HOME/.nvm"
# Uncomment to `yarn install` in th-web, Trailmaker, etc.
# . "/opt/homebrew/opt/nvm/nvm.sh"
# Uncomment to run th-web
# export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
# Uncomment for Trailmaker
# export PYENV_ROOT="$HOME/.pyenv"
# command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
# eval "$(pyenv init -)"
# ruby compilation
export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/libffi/lib/pkgconfig"
export LDFLAGS="$LDFLAGS -L/opt/homebrew/opt/[email protected]/lib"
export CPPFLAGS="$CPPFLAGS -I/opt/homebrew/opt/[email protected]/include"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/homebrew/opt/[email protected]/lib/pkgconfig"
# export LDFLAGS="$LDFLAGS -L/opt/homebrew/opt/postgresql@12/lib"
# export CPPFLAGS="$CPPFLAGS -I/opt/homebrew/opt/postgresql@12/include"
# export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/homebrew/opt/postgresql@12/lib/pkgconfig"
eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(rbenv init -)"