-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
78 lines (66 loc) · 1.87 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
# Autoloads
autoload -U compinit; compinit
autoload -U colors; colors
autoload -Uz vcs_info
# ZSH Options
setopt share_history
# plugins
plugins=(git ssh-agent)
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
zstyle ':vcs_info:*' stagedstr '%F{28}●'
zstyle ':vcs_info:*' unstagedstr '%F{11}●'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
zstyle ':vcs_info:*' enable git svn
precmd () {
local num_untracked="$(git ls-files --other --exclude-standard 2> /dev/null | wc -l)"
if [[ $num_untracked -ne 0 ]] {
local untracked="%F{red}●"
}
zstyle ':vcs_info:*' formats "[%F{cyan}%b%c%u${untracked}%f] "
vcs_info
}
# History
HISTFILE=~/.zhistory
HISTSIZE=1100000
SAVEHIST=1000000
setopt appendhistory
# Pagers and Editors
set -o vi
export EDITOR="vim"
export VISUAL="vim"
export CLICOLOR="yes"
# Prompt
setopt prompt_subst
export PS1='${vcs_info_msg_0_}%F{red}%h%f> '
# Platform Specific
case $(uname -s) in
"OpenBSD")
alias ls='colorls'
export LC_CTYPE="en_US.UTF-8"
;;
"Linux")
alias grep='grep --color=auto'
alias ls='ls --color=auto'
;;
"Darwin")
# Needed for homebrew.
export PATH="/usr/local/bin:${PATH}"
export PATH="${PATH}:/usr/local/sbin"
;;
esac
# Macros:
# Read man pages with vim
vman() {
vim -c "SuperMan $*"
if [ "$?" != "0" ]; then
echo "No manual entry for $*"
fi
}
compdef vman="man"
# Source Local ZSH Configs
zshrc_local="${HOME}/.zshrc_local"
if [[ -e "$zshrc_local" ]]; then
source "$zshrc_local"
fi
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"