-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc
70 lines (52 loc) · 1.71 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
# completion
autoload -U compinit && compinit
# TODO: need description
autoload -U select-word-style && select-word-style bash
# for some nice batch actions to files
autoload -U zmv
# use vim as an editor
export VISUAL='vim'
export EDITOR=$VISUAL
# incremental search
bindkey '^R' history-incremental-search-backward
bindkey '^S' history-incremental-search-forward
bindkey '^P' history-search-backward
bindkey '^N' history-search-forward
df=('aliases' 'functions')
for f in $df; do
if [ -e "$HOME/.$f" ]; then
source "$HOME/.$f"
fi
done
if [ -e "${HOME}/.iterm2_shell_integration.zsh" ]; then
source "${HOME}/.iterm2_shell_integration.zsh"
export ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=YES
fi
if which brew > /dev/null; then
source $(brew --prefix asdf)/libexec/asdf.sh
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
fi
HISTSIZE=4096
SAVEHIST=4096
HISTFILE=~/.history
# automatically find the directory
setopt auto_cd
cdpath=($HOME/projects $HOME/external)
# expand functions in the prompt
setopt prompt_subst
# prompt
export PS1='%{$fg_bold[red]%}$(parse_git_branch)%{$reset_color%}[${SSH_CONNECTION+"%{$fg_no_bold[green]%}%n@%m:"}%{$fg_no_bold[cyan]%}%2d%{$reset_color%} %{$fg_no_bold[magenta]%}$(parse_git_uncommitted)$(parse_git_unpushed)%{$reset_color%}] %{$fg_no_bold[green]%}%% %{$reset_color%}'
# for Homebrew executables
export PATH="/usr/local/sbin:$PATH"
# custom executables
export PATH="$HOME/.bin:$PATH"
# Go dev
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# VS Code
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export GPG_TTY=$(tty)
export HISTTIMEFORMAT="%F %T "
if which rbenv > /dev/null; then
eval "$(rbenv init -)"
fi