-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
69 lines (52 loc) · 1.55 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
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
export GOPATH=~/go
export PYTHONDONTWRITEBYTECODE=1
export VISUAL=vim
export EDITOR=vim
bindkey -e
bindkey '^[OA' history-beginning-search-backward
bindkey '^[OB' history-beginning-search-forward
export KEYTIMEOUT=1
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/ruhland/.zshrc'
autoload -Uz compinit promptinit
# history
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
# git
autoload -Uz vcs_info
zstyle ':vcs_info:git:*' formats '[%b]'
plugins=(git virtualenv)
set_virtual_env() {
if [[ -n "$VIRTUAL_ENV" ]]; then
echo " %F{cyan}(${VIRTUAL_ENV:t})%f"
else
echo ""
fi
}
PROMPT="%F{red}%n %F{blue}%3~%f$(set_virtual_env)"
precmd() {
vcs_info
PROMPT="%F{red}%n %F{blue}%3~%f$(set_virtual_env)"
if [[ -n ${vcs_info_msg_0_} ]]; then
# vcs_info found something (the documentation got that backwards
# STATUS line taken from https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/git.zsh
STATUS=$(command git status --porcelain 2> /dev/null | tail -n1)
if [[ -n $STATUS ]]; then
PROMPT="$PROMPT %F{red}${vcs_info_msg_0_} %f%# "
else
PROMPT="$PROMPT %F{green}${vcs_info_msg_0_} %f%# "
fi
else
PROMPT="$PROMPT %f%# "
fi
}
setopt PROMPT_SUBST
compinit
# End of lines added by compinstall
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
eval "$(direnv hook zsh)"