-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc_docker
174 lines (144 loc) · 5.55 KB
/
.zshrc_docker
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
# zsh options directories
setopt auto_cd
setopt auto_pushd
setopt pushd_ignore_dups
setopt pushd_minus
# zsh options history
HISTFILE=/home/doune/.zsh_history
HISTSIZE=50000
SAVEHIST=10000
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_space
setopt hist_verify
setopt share_history
# style for completion -- exerpt from oh-my-zsh
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path $ZSH_CACHE_DIR
zstyle ':completion:*' list-colors ''
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -g -A key
key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
key[Insert]="${terminfo[kich1]}"
key[Backspace]="${terminfo[kbs]}"
key[Delete]="${terminfo[kdch1]}"
key[Up]="${terminfo[kcuu1]}"
key[Down]="${terminfo[kcud1]}"
key[Left]="${terminfo[kcub1]}"
key[Right]="${terminfo[kcuf1]}"
key[PageUp]="${terminfo[kpp]}"
key[PageDown]="${terminfo[knp]}"
key[Shift-Tab]="${terminfo[kcbt]}"
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey -- "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey -- "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey -- "${key[Insert]}" overwrite-mode
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}" backward-delete-char
[[ -n "${key[Delete]}" ]] && bindkey -- "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey -- "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey -- "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey -- "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey -- "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey -- "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey -- "${key[PageDown]}" end-of-buffer-or-history
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}" reverse-menu-complete
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
autoload -Uz add-zle-hook-widget
function zle_application_mode_start { echoti smkx }
function zle_application_mode_stop { echoti rmkx }
add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi
# additionnal key bindings
# if [[ "${terminfo[khome]}" != "" ]]; then
# bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line
# fi
# if [[ "${terminfo[kend]}" != "" ]]; then
# bindkey "${terminfo[kend]}" end-of-line # [End] - Go to end of line
# fi
# if [[ "${terminfo[kdch1]}" != "" ]]; then
# bindkey "${terminfo[kdch1]}" delete-char # [Delete] - delete forward
# fi
source $HOME/.zplug/init.zsh
# self-manage for zplug
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
# aliases you should use
zplug "MichaelAquilina/zsh-you-should-use"
# command suggestion
zplug "zsh-users/zsh-autosuggestions"
bindkey '^ ' autosuggest-accept
# interactive git plugin
zplug "wfxr/forgit"
# git add commit push all in one command
zplug "robertzk/send.zsh"
# fuzzy directory completion
zplug "changyuheng/fz", defer:1
zplug "rupa/z", use:z.sh
# automatic pairing for brackets and others
zplug "hlissner/zsh-autopair", defer:2
# syntax highlight
zplug "zdharma/fast-syntax-highlighting", defer:2
# command history
zplug "zsh-users/zsh-history-substring-search", defer:3
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
zplug load
path+=/home/doune/bin
export PATH
export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
export EDITOR=nvim
# alias
alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'
alias -- -='cd -'
alias 1='cd -'
alias 2='cd -2'
alias 3='cd -3'
alias 4='cd -4'
alias md='mkdir -p'
alias rd='rmdir'
alias l='exa -la --git'
alias ll='exa -l --git'
alias lt='exa -laT --level=2 --git'
alias llt='exa -lT --level=2 --git'
alias ldir='exa -laD --git'
alias lnew='exa -lasnew --git'
alias _='sudo '
alias h='fc -RI'
alias updt='trizen -Syu --noconfirm --noedit'
alias matlab='xhost +local:root && sudo docker run -it -e DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix:rw -v /home/doune/Documents/ENSSAT/matlab/:/home/moi:rw --rm enssat/matlab "" && xhost -local:root'
alias pulseffectsd='pulseeffects --gapplication-service'
eval "$(starship init zsh)"
unsetopt BEEP
# from prezto gpg module
_gpg_agent_conf="${GNUPGHOME:-$HOME/.gnupg}/gpg-agent.conf"
_gpg_agent_env="${XDG_CACHE_HOME:-$HOME/.cache}/gpg-agent.env"
source "$_gpg_agent_env" 2> /dev/null
if [[ -z "$GPG_AGENT_INFO" && ! -S "${GNUPGHOME:-$HOME/.gnupg}/S.gpg-agent" ]]; then
if ! ps -U "$LOGNAME" -o pid,ucomm | grep -q -- "${${${(s.:.)GPG_AGENT_INFO}[2]}:--1} gpg-agent"; then
mkdir -p "$_gpg_agent_env:h"
eval "$(gpg-agent --daemon | tee "$_gpg_agent_env")"
fi
fi
# ssh authentification using gpg key
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=$(tty)
eval "$(gpg-connect-agent updatestartuptty /bye >/dev/null)"