-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
89 lines (69 loc) · 1.5 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
autoload colors
autoload -Uz vcs_info
precmd() {
vcs_info
}
# Prompt
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats '[%b%m%u%c]'
zstyle ':vcs_info:*' actionformats '[%b|%a]'
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "%F{green}*%f"
zstyle ':vcs_info:git:*' unstagedstr "%F{yellow}*%f"
setopt PROMPT_SUBST
PROMPT=$'\n''%F{cyan}%1d%#%f '
RPROMPT='${vcs_info_msg_0_}'
# History
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt hist_ignore_dups
setopt share_history
autoload history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
# Key
bindkey -e
bindkey "^n" history-beginning-search-forward-end
bindkey "^p" history-beginning-search-backward-end
# Completion
autoload -U compinit
compinit
# Word Selection
autoload -U select-word-style
select-word-style bash
# Other Zsh Settings
setopt auto_pushd
# Aliases
case "${OSTYPE}" in
freebsd*|darwin*)
alias ls="ls -FG"
;;
linux*)
alias ls="ls -F --color"
;;
esac
alias ll="ls -la"
alias la="ls -a"
# peco
if (( $+commands[peco] )); then
function peco-select-history() {
local tac
if (( $+commands[tac] )); then
tac="tac"
else
tac="tail -r"
fi
BUFFER=$(history -n 1 | \
eval $tac | \
peco --query "$LBUFFER")
CURSOR=$#BUFFER
zle clear-screen
}
zle -N peco-select-history
bindkey '^r' peco-select-history
fi
# Local Settings
if [ -f ~/.zshrc_local ]; then
source ~/.zshrc_local
fi