1 # -------------------------------------------------------------
3 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6 # License: Trivial work, not eligible to copyright
7 # -------------------------------------------------------------
9 # -------------------------------------------------------------
11 # -------------------------------------------------------------
17 # :: Compatibility with csh
22 # :: Aliases for salt-wrapper
24 # -------------------------------------------------------------
26 # -------------------------------------------------------------
29 # This section has been prepared with compinstall
30 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
32 zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
33 zstyle ':completion:*' completions 1
34 zstyle ':completion:*' glob 1
35 zstyle ':completion:*' matcher-list ''
36 zstyle ':completion:*' max-errors 4
37 zstyle ':completion:*' substitute 1
44 # -------------------------------------------------------------
46 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
53 # -------------------------------------------------------------
55 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
59 # -------------------------------------------------------------
61 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
65 # -------------------------------------------------------------
66 # Compatibility with csh
68 # makecheck / https://news.ycombinator.com/item?id=4201636
69 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
72 if [ "x$1" = "x" ] ; then
73 echo "$0: environment variable name required" >&2
74 elif [ "x$2" = "x" ] ; then
75 echo "$0: environment variable value required" >&2
82 if [ "x$1" = "x" ] ; then
83 echo "$0: environment variable name required" >&2
89 # -------------------------------------------------------------
91 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
93 source $HOME/bin/ssh-agent-session
95 # -------------------------------------------------------------
98 # http://zshwiki.org/home/zle/bindkeys
99 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
103 [[ $TERM == screen ]] && TERM=screen-256color
106 function zkbd_file() {
107 [[ -f ~/.zkbd/${TERM}-${VENDOR}-${OSTYPE} ]] && printf '%s' ~/".zkbd/${TERM}-${VENDOR}-${OSTYPE}" && return 0
108 [[ -f ~/.zkbd/${TERM}-${DISPLAY} ]] && printf '%s' ~/".zkbd/${TERM}-${DISPLAY}" && return 0
112 [[ ! -d ~/.zkbd ]] && mkdir ~/.zkbd
115 if [[ ${ret} -ne 0 ]]; then
120 if [[ ${ret} -eq 0 ]] ; then
123 printf 'Failed to setup keys using zkbd.\n'
125 unfunction zkbd_file; unset keyfile ret
127 autoload -U up-line-or-beginning-search
128 autoload -U down-line-or-beginning-search
129 zle -N up-line-or-beginning-search
130 zle -N down-line-or-beginning-search
132 export WORDCHARS='*?_[]~=&;!#$%^(){}'
134 [[ -n "$key[Home]" ]] && bindkey -- "$key[Home]" beginning-of-line
135 [[ -n "$key[End]" ]] && bindkey -- "$key[End]" end-of-line
136 [[ -n "$key[Insert]" ]] && bindkey -- "$key[Insert]" overwrite-mode
137 [[ -n "$key[Backspace]" ]] && bindkey -- "$key[Backspace]" backward-delete-char
138 [[ -n "$key[Delete]" ]] && bindkey -- "$key[Delete]" delete-char
139 [[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
140 [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
141 [[ -n "$key[Left]" ]] && bindkey -- "$key[Left]" backward-char
142 [[ -n "$key[Right]" ]] && bindkey -- "$key[Right]" forward-char
144 # -------------------------------------------------------------
148 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
152 # -------------------------------------------------------------
155 # :: alias to git-achievements
158 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
160 alias git=git-achievements
161 compdef git-achievements=git
164 autoload -Uz vcs_info
166 zstyle ':vcs_info:*' actionformats \
167 '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
168 zstyle ':vcs_info:*' formats \
169 '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
170 zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
172 zstyle ':vcs_info:*' enable git cvs svn
176 if [ -n "$vcs_info_msg_0_" ]; then
177 echo "%{$fg[grey]%}${vcs_info_msg_0_}%{$reset_color%}$del"
180 RPROMPT=$'$(vcs_info_wrapper)'
182 # -------------------------------------------------------------
185 # https://docs.nasqueron.org/salt-wrapper/admin.html#shell-aliases
186 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
188 alias salt='salt-wrapper salt'
189 alias salt-call='salt-wrapper salt-call'
190 alias salt-cloud='salt-wrapper salt-cloud'
191 alias salt-key='salt-wrapper salt-key'
192 alias salt-run='salt-wrapper salt-run'
193 alias salt-ssh='salt-wrapper salt-ssh'