forked from lbesnard/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc.zplug.ssh
123 lines (100 loc) · 3.56 KB
/
zshrc.zplug.ssh
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
# Set up the prompt
export TERM="xterm-256color"
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
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
# python venv
[ -f /usr/local/bin/virtualenvwrapper.sh ] && source /usr/local/bin/virtualenvwrapper.sh
# Essential
source ~/.zplug/init.zsh
# completion
_cmpl_cheat() {
reply=($(cheat -l | cut -d' ' -f1))
}
compctl -K _cmpl_cheat cheat
# 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;
# highlight options
export LSCOLORS=ExfxcxdxbxGxDxabagacad
zstyle ':completion:*' list-colors ${LSCOLORS}
zstyle ':completion:*:default' menu select=2
BULLETTRAIN_VIRTUALENV_PREFIX=""
BULLETTRAIN_VIRTUALENV_BG=30
BULLETTRAIN_RUBY_SHOW=false
zplug "plugins/command-not-found", 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/sublime", from:oh-my-zsh
zplug "zsh-users/zsh-completions"
## Syntax highlighting bundle.
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-history-substring-search"
#zplug "chrissicool/zsh-bash"
# Load the theme.
setopt prompt_subst # Make sure propt is able to be generated properly.
#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
#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
# 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/*;
alias sudo_project_officer='sudo -u projectofficer -i'
fi
_cmpl_inputlog() {
reply=($(ls -d $ERROR_DIR/* | sed 's@.*/@@'))
reply=($(echo $reply | tr -s " " "\012"))
}
compctl -K _cmpl_inputlog input_logf
compctl -K _cmpl_inputlog input_log
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