-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
124 lines (99 loc) · 3.32 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
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
#history file
#export HISTFILE=$HOME/.zsh_history
#set history size
#export HISTSIZE=100000
#save history after logout
#export SAVEHIST=100000
#append into history file
setopt inc_append_history
# delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_expire_dups_first
#add timestamp for each entry
setopt extended_history
#share command history data
setopt share_history
#save only one command if 2 common are same and consistent
setopt hist_ignore_dups
# show command with history expansion to user before running it
setopt hist_verify
setopt shwordsplit
autoload -U promptinit
promptinit
setopt PROMPT_SUBST
setopt interactivecomments
# Keybinding
bindkey -e
bindkey '^i' expand-or-complete-prefix
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
bindkey "${terminfo[khome]}" beginning-of-line
bindkey "${terminfo[kend]}" end-of-line
bindkey "${terminfo[kcbt]}" reverse-menu-complete
bindkey "${terminfo[kdch1]}" delete-char
autoload -U select-word-style
select-word-style bash
# Syntax Highlighting
if [ -d /opt/homebrew/share/zsh-syntax-highlighting/ ]; then
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_STYLES[globbing]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[comment]='fg=yellow,bold'
fi
#Command not found
if [[ -f /etc/zsh_command_not_found ]]; then
. /etc/zsh_command_not_found
fi
# Autosuggestions
if [ -d /opt/homebrew/share/zsh-autosuggestions/ ]; then
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
fi
# History substring search
if [ -d /opt/homebrew/share/zsh-history-substring-search/ ]; then
source /opt/homebrew/share/zsh-history-substring-search/zsh-history-substring-search.zsh
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
fi
source ~/.zprofile
#eval "$(fasd --init zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install)"
eval "$(zoxide init zsh)"
source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc"
source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc"
#export TERM=screen-256color
#if which tmux > /dev/null 2>&1; then
# test -z ${TMUX} && exec tmux
## attach to sessions that might exist on exit
# while test -z ${TMUX}; do
# tmux attach || break
# done
#fi
#source <(helm completion zsh)
#source <(kubectl completion zsh)
#kubectl completion zsh > "/usr/share/zsh/site-functions/_kubectl"
if [[ -f $HOME/.stern_completion ]]; then
source $HOME/.stern_completion
fi
if [[ -f $HOME/.kubectl-completion-zsh ]]; then
source $HOME/.kubectl-completion-${SHELL##*/}
fi
if [[ -f $HOME/.kubecm-completion-zsh ]]; then
source $HOME/.kubecm-complete-${SHELL##*/}
fi
if [[ -f $HOME/.k9s-completion-zsh ]]; then
source $HOME/.k9s-completion-${SHELL##*/}
fi
. $HOME/.commonrc
PROMPT='$(gbt $?)'
RPROMPT='$(gbt -right)'
#ASDF configuration
#. "$HOME/.asdf/asdf.sh"
# append completions to fpath
#fpath=(${ASDF_DIR}/completions $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit && compinit
autoload -U +X bashcompinit && bashcompinit
complete -o nospace -C /home/eabdulrahman/bin/mc mc
zstyle ':completion:*' menu select
fpath+=~/.zfunc
# source /home/eabdulrahman/.config/broot/launcher/bash/br