-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
executable file
·81 lines (64 loc) · 1.77 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
zstyle ':completion:*' completer _complete _ignored
zstyle :compinstall filename '/Users/jon/.zshrc'
autoload -Uz compinit
compinit
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory notify
unsetopt beep
bindkey -e
# Report what's going on for long commands.
export REPORTTIME=10
# History searching.
bindkey '^R' history-incremental-search-backward
bindkey '^[[A' history-search-backward
bindkey '^[[B' history-search-forward
bindkey '^[[3~' delete-char
# Mac-like cursor movement.
bindkey '[C' forward-word
bindkey '[D' backward-word
bindkey '[G' backward-kill-word # opt-backspace
bindkey '[H' kill-word # opt-delete
# Aliases.
alias diff="`whence colordiff || echo "diff"` -u"
alias ll='ls -lh'
alias la='ls -a'
alias lla='ls -alh'
alias lb='llbuild ninja build'
alias gd='git diff | wdiff -dn | colordiff | less -r'
alias gs='git stash'
alias gsp='git stash pop'
# Git branches on the command line.
git_branch_prompt() {
local branch=`git rev-parse --abbrev-ref HEAD 2> /dev/null`
if [ $branch ]; then
print "[%F{cyan}$branch%F{default}]"
fi
}
# Pretty colors for the command line.
export CLICOLOR=1
setopt PROMPT_SUBST
PROMPT="%F{default}[%(!.%F{red}.%F{green})%m %F{blue}%2~%F{default}]"
PROMPT="${PROMPT}\$(git_branch_prompt)"
PROMPT="${PROMPT}%(!.#.\$) "
RPROMPT='%F{blue}%*'
# Use 256 colours.
case "$TERM" in
screen)
export TERM=screen-256color
;;
xterm)
export TERM=xterm-256color
;;
esac
# Local binaries take precedence over all others
if [ -e "${HOME}/bin" ]; then
export PATH=${HOME}/bin:$PATH
fi
# Finally, local configuration.
if [ -e "${HOME}/.local/zprofile" ]; then
source ${HOME}/.local/zprofile
fi
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"