-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
111 lines (85 loc) · 2.61 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Aliase
########
# colored and paged SVN diff
alias svndiff='svn diff $* | colordiff | less -r'
alias ...='cd ../..'
# History
########
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups # ignore duplication command history list
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history # share command history data
# keep TONS of history
export HISTSIZE=4096
export SAVEHIST=4096
export HISTFILE=~/.zsh_history
# automatically pushd
setopt auto_pushd
export dirstacksize=5
# Try to correct command line spelling
setopt CORRECT CORRECT_ALL
# Enable extended globbing
setopt EXTENDED_GLOB
# ls colors
autoload colors; colors;
export LSCOLORS="Gxfxcxdxbxegedabagacad"
#export LS_COLORS
# Enable ls colors
if [ "$DISABLE_LS_COLORS" != "true" ]
then
# Find the option for using colors in ls, depending on the version: Linux or BSD
ls --color -d . &>/dev/null 2>&1 && alias ls='ls --color=tty' || alias ls='ls -G'
fi
#setopt no_beep
setopt auto_cd
setopt multios
setopt cdablevarS
if [[ x$WINDOW != x ]]
then
SCREEN_NO="%B$WINDOW%b "
else
SCREEN_NO=""
fi
# Apply theming defaults
PS1="%n@%m:%~%# "
# Colors
########
typeset -Ag FX FG BG
LSCOLORS="exfxcxdxbxegedabagacad"
LS_COLORS="di=34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:"
FX=(
reset "%{[00m%}"
bold "%{[01m%}" no-bold "%{[22m%}"
italic "%{[03m%}" no-italic "%{[23m%}"
underline "%{[04m%}" no-underline "%{[24m%}"
blink "%{[05m%}" no-blink "%{[25m%}"
reverse "%{[07m%}" no-reverse "%{[27m%}"
)
for color in {000..255}; do
FG[$color]="%{[38;5;${color}m%}"
BG[$color]="%{[48;5;${color}m%}"
done
# Prompt
########
# autoload -U add-zsh-hook
autoload -Uz vcs_info
# # enable VCS systems you use
zstyle ':vcs_info:*' enable git svn
zstyle ':vcs_info:*:prompt:*' check-for-changes true
setopt prompt_subst
autoload -U promptinit
promptinit
# Look at http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information
# for mor options
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '*' # display this when there are unstaged changes
zstyle ':vcs_info:*' stagedstr '+' # display this when there are staged changes
zstyle ':vcs_info:*' actionformats '[%b%|%a%c%u%]%f'
zstyle ':vcs_info:*' formats ':%b%c%u%f'
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
precmd () { vcs_info }
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}${vcs_info_msg_0_}%{$fg_bold[blue]%} % %{$reset_color%}'