-
Notifications
You must be signed in to change notification settings - Fork 1
/
.zshrc
90 lines (71 loc) · 1.97 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
if [ $TERM = "dumb" ]
then
unsetopt zle
exec sh
else
exec fish
fi
# Save the location of the current completion dump file.
if [ -z "$ZSH_COMPDUMP" ]; then
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi
# Load and run compinit
autoload -U compinit
compinit -i -d "${ZSH_COMPDUMP}"
# Use history
SAVEHIST=15000
HISTFILE=~/.zsh_history
setopt sharehistory
setopt extendedhistory
bindkey '\e[1;5A' history-beginning-search-backward
bindkey '\e[1;5B' history-beginning-search-forward
# Superglobs!
setopt extendedglob
unsetopt caseglob
# Load sourcefiles
[ -f ~/.profile ] && source $HOME/.profile
# Detect what platform this is for other scripts
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'Bitrig' ]]; then
platform='bitrig'
elif [[ "$unamestr" == 'Darwin' ]]; then
platform='osx'
fi
# report long running command CPU usage
REPORTTIME=60
# Detect what kind of proc we have
proc=`uname -p`
# My path
export PATH=/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/sbin:/usr/bin:/home/xena/bin:/home/xena/.linuxbrew/bin
# Vim is love, vim is life
export EDITOR=vim
NAME="%n@"
if [ -n "$DOCKER" ]
then
NAME="%{$fg[blue]%}$NAME""docker:%{$reset_color%}%m "
else
NAME="$NAME""%m "
fi
if [[ platform != "linux" ]]
then
NAME="$NAME""($platform) "
fi
function __ret_status {
echo "%(?:%{$fg[green]%}➜ :%{$fg[red]%}➜ %s)"
}
PROMPT='$NAME%{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}
%{$fg_bold[gray]%}$(__ret_status) %{$reset_color%}'
# Load extended ZSH aliases and completions
for file in ~/.zsh/*.zsh
do
source $file
done
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# The next line updates PATH for the Google Cloud SDK.
[ -d ~/google-cloud-sdk/ ] && source '/home/xena/google-cloud-sdk/path.zsh.inc'
# The next line enables shell command completion for gcloud.
[ -d ~/google-cloud-sdk/ ] && source '/home/xena/google-cloud-sdk/completion.zsh.inc'
[ $TERM = "dumb" ] && unsetopt zle && PS1='$ '