forked from lbesnard/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc.zgen
127 lines (103 loc) · 3.48 KB
/
zshrc.zgen
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
# Set up the prompt
export TERM="xterm-256color"
#export PATH="$HOME/usr/bin:$PATH"
#export PATH="$HOME/.linuxbrew/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 HOST=ᐉ
setopt nosharehistory
[ -f $HOME/.env ] && source $HOME/.env
[ -f $HOME/.alias ] && source $HOME/.alias
source /etc/profile.d/* # especially useful for remote connection
zgen_zsh=$HOME/.zgen/zgen.zsh
if [ ! -f $zgen_zsh ]; then
echo "Installing zgen..."
echo ""
mkdir -p ~/.zgen;
curl https://raw.githubusercontent.com/tarjoilija/zgen/master/zgen.zsh > $HOME/.zgen/zgen.zsh;
fi
source $zgen_zsh
# Background Agents
command -v ssh-agent >/dev/null 2>&1 && zgen oh-my-zsh plugins/ssh-agent
command -v gpg-agent >/dev/null 2>&1 && zgen oh-my-zsh plugins/gpg-agent
# 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=(dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status )
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
# pip venv
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
if ! zgen saved; then
echo "Creating a zgen save"
zgen oh-my-zsh
zgen oh-my-zsh plugins/command-not-found
zgen oh-my-zsh plugins/gitfast
zgen oh-my-zsh plugins/sudo
zgen oh-my-zsh plugins/common-aliases
zgen oh-my-zsh plugins/autojump
#zgen oh-my-zsh plugins/tmux
zgen oh-my-zsh plugins/sublime
#zgen oh-my-zsh plugins/vundle
zgen load zsh-users/zsh-completions
## Syntax highlighting bundle.
zgen load zsh-users/zsh-syntax-highlighting
zgen loadall <<EOPLUGINS zsh-users/zsh-history-substring-search ./zsh-history-substring-search.zsh
EOPLUGINS
zgen oh-my-zsh plugins/web-search
zgen oh-my-zsh plugins/vagrant
zgen load zsh-users/zsh-autosuggestions
#zgen load chrissicool/zsh-bash
# Load the theme.
#zgen load bhilburn/powerlevel9k powerlevel9k
zgen oh-my-zsh themes/agnoster
#zgen load caiogondim/bullet-train-oh-my-zsh-theme bullet-train
zgen save
fi
#vundle-init
bindkey "\033[1~" beginning-of-line
bindkey "\033[4~" end-of-line
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;
compinit $DATA_SERVICES_DIR/profile.d/*;
fi
if command -v tmux>/dev/null; then
[[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux -2 attach;
fi