forked from lbesnard/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc.zplug
193 lines (156 loc) · 5.72 KB
/
zshrc.zplug
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# Set up the prompt
export TERM="xterm-256color"
#export PATH="$HOME/usr/bin:$PATH"
export PATH="$HOME/.linuxbrew/bin:$PATH"
export PATH="/opt/MATLAB/R2014b/bin:$PATH"
export MANPATH="/home/lbesnard/.linuxbrew/share/man:$MANPATH"
export INFOPATH="/home/lbesnard/.linuxbrew/share/info:$INFOPATH"
export SHELL=$HOME/.linuxbrew/bin/zsh
export DEFAULT_USER=loz
export DISPLAY=:0.0
#export HOST=ᐉ
setopt nosharehistory
setopt interactivecomments
[ -f $HOME/.env ] && source $HOME/.env
[ -f $HOME/.alias ] && source $HOME/.alias
source /etc/profile.d/* # especially useful for remote connection
# check if zplug is installed
if [[ ! -d ~/.zplug ]]; then
git clone https://github.com/zplug/zplug ~/.zplug
source ~/.zplug/init.zsh && zplug update --self
fi
# Essential
source ~/.zplug/init.zsh
# Background Agents
command -v ssh-agent >/dev/null 2>&1 && zplug "plugins/ssh-agent", from:oh-my-zsh
command -v gpg-agent >/dev/null 2>&1 && zplug "plugins/gpg-agent", from:oh-my-zsh
# completion
_cmpl_cheat() {
reply=($(cheat -l | cut -d' ' -f1))
}
compctl -K _cmpl_cheat cheat
# Configure ssh-agent plugin
zstyle :omz:plugins:ssh-agent agent-forwarding on # Enabled agent forwarding
zstyle :omz:plugins:ssh-agent identities id_rsa # Only auto load rsa keys
# if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"
# change the size of history files
export HISTSIZE=32768;
export HISTFILESIZE=$HISTSIZE;
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
(umask 066; /usr/bin/ssh-agent > "${SSH_ENV}")
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
# tmux plugin settings
# this always starts tmux
ZSH_TMUX_AUTOSTART=true
ZSH_TMUX_AUTOSTART_ONCE=true
ZSH_TMUX_FIXTERM=true
ZSH_TMUX_AUTOQUIT=false
#POWERLEVEL9K_PROMPT_ON_NEWLINE=true
#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status)
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
BULLETTRAIN_VIRTUALENV_BG=30
BULLETTRAIN_RUBY_SHOW=false
BULLETTRAIN_PROMPT_ORDER=(time dir virtualenv git)
BULLETTRAIN_CONTEXT_SHOW=true
#BULLETTRAIN_IS_SSH_CLIENT=true
# pip venv
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
zplug "zsh-users/zsh-autosuggestions"
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "plugins/zsh-navigation-tools", from:oh-my-zsh
zplug "plugins/virtualenv", from:oh-my-zsh
zplug "plugins/gitfast", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
#zplug "plugins/common-aliases", from:oh-my-zsh
zplug "plugins/autojump", from:oh-my-zsh
zplug "plugins/heroku", from:oh-my-zsh
zplug "plugins/sublime", from:oh-my-zsh
zplug "zsh-users/zsh-completions"
## Syntax highlighting bundle.
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "plugins/web-search", from:oh-my-zsh
zplug "plugins/vagrant", from:oh-my-zsh
#zplug "horosgrisa/zsh-dropbox"
#zplug "joepvd/grep2awk"
#zplug "chrissicool/zsh-bash"
zplug "soimort/translate-shell"
zplug "zsh-users/zsh-history-substring-search", defer:2
# Load the theme.
setopt prompt_subst # Make sure propt is able to be generated properly.
#zplug "themes/agnoster", from:oh-my-zsh, use:agnoster.zsh-theme
#zplug "bhilburn/powerlevel9k", use:powerlevel9k.zsh-theme
#zplug "adambiggs/zsh-theme", use:adambiggs.zsh-theme
zplug "caiogondim/bullet-train-oh-my-zsh-theme", use:bullet-train.zsh-theme
if ! zplug check --verbose; then
zplug install
fi
# source plugins and add commands to the PATH
zplug load
. ~/.zplug/repos/robbyrussell/oh-my-zsh/plugins/common-aliases/common-aliases.plugin.zsh
# highlight options
export LSCOLORS=ExfxcxdxbxGxDxabagacad
zstyle ':completion:*' list-colors ${LSCOLORS}
zstyle ':completion:*:default' menu select=2
#ZSH history
setopt append_history
setopt hist_expire_dups_first
setopt hist_fcntl_lock
setopt hist_ignore_all_dups
setopt hist_lex_words
setopt hist_reduce_blanks
setopt hist_save_no_dups
#setopt share_history
export CLICOLOR=1
export BLOCK_SIZE=human-readable # https://www.gnu.org/software/coreutils/manual/html_node/Block-size.html
export HISTSIZE=11000
export SAVEHIST=10000
export HISTFILE=~/.zsh_history
#source repos/robbyrussell/oh-my-zsh/lib/spectrum.zsh
# binkey for HOME END
bindkey "\033[1~" beginning-of-line
bindkey "\033[4~" end-of-line
bindkey "^[[3~" delete-char
if [ ! -z ${SSH_TTY} ]; then
#source $DATA_SERVICES_DIR/profile.d/util.sh &>/dev/null;
#source $DATA_SERVICES_DIR/profile.d/input.sh &>/dev/null;
source $DATA_SERVICES_DIR/profile.d/* &>/dev/null;
source $DATA_SERVICES_DIR/lib/common/* &>/dev/null;
compinit $DATA_SERVICES_DIR/profile.d/*;
fi
if zplug check zsh-users/zsh-history-substring-search; then
zmodload zsh/terminfo
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
fi
#if command -v tmux>/dev/null; then
#[[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux -2 attach;
#fi
alias tmux_start="[[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux -2 attach"
test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
test -r ~/.bash_profile && echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.bash_profile
echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.profile
# beets
#autoload bashcompinit
#bashcompinit
#_get_comp_words_by_ref() { :; }
#compopt() { :; }
#_filedir() { :; }
#eval "$(beet completion)"