-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_zshrc
64 lines (53 loc) · 1.42 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
fpath=(~/.zsh/zsh-completions/src $fpath)
autoload -Uz compinit
compinit
setopt list_packed
setopt list_rows_first
setopt list_types
autoload -Uz colors
colors
PROMPT="%m%{${fg[green]}%}%# %{$reset_color%}"
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats '%r/%S -[%b]'
zstyle ':vcs_info:*' actionformats '%r/%S -[%b|%a]'
precmd () {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
}
RPROMPT="%1(v|%F{green}%1v%f|)"
setopt auto_pushd
setopt pushd_ignore_dups
# history
HISTFILE=~/.zhistory
HISTSIZE=100000
SAVEHIST=1000000
setopt share_history
setopt extended_history
setopt inc_append_history
setopt hist_ignore_all_dups
setopt hist_save_nodups
# alias
alias ls='ls -GF'
alias ll='ls -l'
alias la='ls -a'
alias lla='ls -la'
alias vim='/Applications/MacVim.app/Contents/MacOS/Vim'
alias vi=vim
alias diff=colordiff
# for autojump
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
# custom history
function exists { which $1 &> /dev/null }
if exists percol; then
function percol_select_history() {
local tac
exists gtac && tac="gtac" || { exists tac && tac="tac" || { tac="tail -r" } }
BUFFER=$(history -n 1 | eval $tac | percol --query "$LBUFFER")
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
zle -N percol_select_history
bindkey '^R' percol_select_history
fi