-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
75 lines (64 loc) · 1.85 KB
/
.zshrc
File metadata and controls
75 lines (64 loc) · 1.85 KB
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
#
# ~/.zshrc
#
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
fpath=($HOME/.local/share/zsh/site-functions $fpath)
setopt autocd extendedglob notify
unsetopt beep nomatch
zstyle :compinstall filename '${HOME}/.zshrc'
zstyle ':completion:*' rehash true
autoload -Uz compinit
compinit
### from https://github.com/graysky2/configs/blob/master/dotfiles/.zshrc
setopt hist_expire_dups_first
setopt hist_ignore_space
setopt inc_append_history
setopt share_history
autoload -Uz up-line-or-beginning-search
autoload -Uz down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '\eOA' up-line-or-beginning-search
bindkey '\e[A' up-line-or-beginning-search
bindkey '\eOB' down-line-or-beginning-search
bindkey '\e[B' down-line-or-beginning-search
### end stuff from graysky2
# fix home, end, del keys
bindkey '^[[1~' beginning-of-line
bindkey '^[[4~' end-of-line
bindkey '^[[3~' delete-char
# source aliases
if [[ -e ~/.aliases ]]; then
source ~/.aliases
fi
# source profile
if [[ -e ~/.profile ]]; then
source ~/.profile
fi
# Git prompt
setopt prompt_subst
autoload -Uz vcs_info
zstyle ':vcs_info:*' actionformats \
'%F{2}%b %F{3}%a%f'
#'%F{5}(%F{2}%s%F{5})%F{8}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
zstyle ':vcs_info:*' formats \
'%b'
#' %F{8}< %F{2}%b %F{8}>%f '
#'%F{5}(%F{2}%s%F{5})%F{8}-%F{5}[%F{2}%b%F{5}]%f '
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
zstyle ':vcs_info:*' enable git
# or use precmd, see man zshcontrib
# prompt
# TODO display git diff --shortstat
precmd() {
vcs_info
git_branch=${vcs_info_msg_0_}
if [[ "$git_branch" == "" ]]; then
export PS1="%F{237}%m%f %F{%(?.64.208)}%~%f %F{%(?.64.208)}%#%f "
else
export PS1="%F{237}%m%f %F{%(?.64.208)}%~%F{237} ${git_branch} %F{%(?.64.208)}%#%f "
fi
}
export PS2=" %F{236}>%f "