[[ -n "$AXZSH_DEBUG" ]] \
&& echo " - Reading cache file \"$cache_file\" ..."
source "$cache_file"
- unfunction ax_plugin_init
+ unfunction axzsh_plugin_init
else
# No cache file available.
local new_cache_file="$cache_file.NEW"
if [[ -n "$cache_file" ]]; then
# Add plugin data to cache
- printf "# BEGIN: %s\nax_plugin_init()\n{\n" "$fname" >>"$cache_file"
+ printf "# BEGIN: %s\naxzsh_plugin_init()\n{\n" "$fname" >>"$cache_file"
case "$fname" in
*"/repos/"*)
echo "[[ -n \"\$AXZSH_DEBUG\" ]] && echo ' - $plugin ($type): \"$fname\" ...'" >>$cache_file
echo "[[ -n \"\$AXZSH_DEBUG\" ]] && echo ' - $plugin ($type, cached) ...'" >>$cache_file
"$cat_cmd" "$fname" >>"$cache_file"
esac
- printf "}\nax_plugin_init\n# END: %s\n\n" "$fname" >>"$cache_file"
+ printf "}\naxzsh_plugin_init\n# END: %s\n\n" "$fname" >>"$cache_file"
fi
fi
fi
for p in $AXZSH/core/*/*.zshrc; do
[[ "$(basename "$p")" == "01_zprofile.zshrc" ]] && continue
- printf "# BEGIN: %s\nax_plugin_init()\n{\n" "$p" >>"$T"
+ printf "# BEGIN: %s\naxzsh_plugin_init()\n{\n" "$p" >>"$T"
cat "$p" >>"$T"
- printf "}\nax_plugin_init\n# END: %s\n\n" "$p" >>"$T"
+ printf "}\naxzsh_plugin_init\n# END: %s\n\n" "$p" >>"$T"
done
ax_msg - "Checking plugins ..."
(
AXZSH_PLUGIN_CHECK=1
source "$T"
- ax_plugin_fnc() { source "$script" }
- ax_plugin_fnc
+ axzsh_plugin_fnc() { source "$script" }
+ axzsh_plugin_fnc
); r=$?
[[ $r -eq 0 ]] && new_plugin=$plugin
break
fi
ZSH_THEME_LOGNAME_PROMPT_SUFFIX_SPACING="@"
-function ax_logname_prompt_root() {
+function axzsh_logname_prompt_root() {
(( $UID == 0 )) || return 1
return 0
}
-function ax_logname_prompt_yn() {
+function axzsh_logname_prompt_yn() {
local func
- for func ($ax_logname_prompt_functions); do
+ for func ($axzsh_logname_prompt_functions); do
$func || continue
echo "${ZSH_THEME_LOGNAME_PROMPT_PREFIX_SPACING}${ZSH_THEME_LOGNAME_PROMPT_PREFIX}${1:-$LOGNAME}${ZSH_THEME_LOGNAME_PROMPT_SUFFIX}${ZSH_THEME_LOGNAME_PROMPT_SUFFIX_SPACING}"
return
done
}
-ax_logname_prompt_functions=(ax_logname_prompt_root)
+axzsh_logname_prompt_functions=(axzsh_logname_prompt_root)
# Hostname
ZSH_THEME_HOSTNAME_PROMPT_SUFFIX=""
ZSH_THEME_HOSTNAME_PROMPT_SUFFIX_SPACING=":"
-function ax_hostname_prompt_root() {
+function axzsh_hostname_prompt_root() {
(( $UID == 0 )) || return 1
return 0
}
-function ax_hostname_prompt_yn() {
+function axzsh_hostname_prompt_yn() {
local func
- for func ($ax_hostname_prompt_functions); do
+ for func ($axzsh_hostname_prompt_functions); do
$func || continue
echo "${ZSH_THEME_HOSTNAME_PROMPT_PREFIX_SPACING}${ZSH_THEME_HOSTNAME_PROMPT_PREFIX}${1:-$SHORT_HOST}${ZSH_THEME_HOSTNAME_PROMPT_SUFFIX}${ZSH_THEME_HOSTNAME_PROMPT_SUFFIX_SPACING}"
return
done
}
-ax_hostname_prompt_functions=()
+axzsh_hostname_prompt_functions=()
# VCS
unset clean dirty ahead behind
-function ax_vcs_prompt() {
+function axzsh_vcs_prompt() {
local func
local p
- for func ($ax_vcs_prompt_functions); do
+ for func ($axzsh_vcs_prompt_functions); do
p=$( $func ) || continue
echo "${ZSH_THEME_VCS_PROMPT_PREFIX_SPACING}${p}${ZSH_THEME_VCS_PROMPT_SUFFIX_SPACING}"
return
done
}
-ax_vcs_prompt_functions=()
+axzsh_vcs_prompt_functions=()
# Prompt
ZSH_THEME_PROMPT_SUFFIX=""
ZSH_THEME_PROMPT_SUFFIX_SPACING=""
-function ax_prompt() {
+function axzsh_prompt() {
local p
(( $UID == 0 )) \
&& p="${ZSH_THEME_PROMPT_ROOT_PREFIX}${ZSH_THEME_PROMPT_ROOT}" \
# 99_cleanup.zlogin: Don't pollute the namespace, remove variables/functions/...
for func (
- ax_hostname_prompt_root
- ax_hostname_prompt_yn
- ax_logname_prompt_root
- ax_logname_prompt_yn
- ax_prompt
+ axzsh_hostname_prompt_root
+ axzsh_hostname_prompt_yn
+ axzsh_logname_prompt_root
+ axzsh_logname_prompt_yn
+ axzsh_prompt
); do
unfunction $func 2>/dev/null
done
-for func ($ax_logname_prompt_functions); do
+for func ($axzsh_logname_prompt_functions); do
unfunction $func 2>/dev/null
done
-unset ax_logname_prompt_functions
+unset axzsh_logname_prompt_functions
-for func ($ax_hostname_prompt_functions); do
+for func ($axzsh_hostname_prompt_functions); do
unfunction $func 2>/dev/null
done
-unset ax_hostname_prompt_functions
+unset axzsh_hostname_prompt_functions
# Try to map OhMyZsh theme Environment ...
[[ -n "$ZSH_THEME_GIT_PROMPT_AHEAD" ]] \
ssh-add
}
-_ax_ssh_prompt() {
+_axzsh_ssh_prompt() {
[[ -n "$SSH_CLIENT" ]] || return 1
return 0
}
-ax_logname_prompt_functions=($ax_logname_prompt_functions _ax_ssh_prompt)
-ax_hostname_prompt_functions=($ax_hostname_prompt_functions _ax_ssh_prompt)
+axzsh_logname_prompt_functions=($axzsh_logname_prompt_functions _axzsh_ssh_prompt)
+axzsh_hostname_prompt_functions=($axzsh_hostname_prompt_functions _axzsh_ssh_prompt)
# Validate SSH_AUTH_SOCK: Inside of screen(1) sessions for example, the socket
# file becomes invalid when the session has been disconnected.
# OhMyZsh compatibility functions
alias parse_git_dirty=git_parse_dirty
-ax_vcs_prompt_functions=($ax_vcs_prompt_functions git_prompt)
+axzsh_vcs_prompt_functions=($axzsh_vcs_prompt_functions git_prompt)
alias fix="gd --name-only | uniq | xargs $EDITOR"
alias g="git"
ZSH_THEME_PROMPT_SUFFIX="%b%{$reset_color%}"
ZSH_THEME_PROMPT_SUFFIX_SPACING=" "
-ax_logname_prompt_functions=($ax_logname_prompt_functions ax_logname_prompt_root)
-ax_hostname_prompt_functions=($ax_hostname_prompt_functions ax_hostname_prompt_root)
+axzsh_logname_prompt_functions=($axzsh_logname_prompt_functions axzsh_logname_prompt_root)
+axzsh_hostname_prompt_functions=($axzsh_hostname_prompt_functions axzsh_hostname_prompt_root)
# The primary prompt string, printed before a command is read.
-PS1="$(ax_logname_prompt_yn)$(ax_hostname_prompt_yn)%B%2~%b"'$(ax_vcs_prompt)'"$(ax_prompt)"
+PS1="$(axzsh_logname_prompt_yn)$(axzsh_hostname_prompt_yn)%B%2~%b"'$(axzsh_vcs_prompt)'"$(axzsh_prompt)"
# Primary prompt on the right-hand side.
axzsh_is_utf_terminal \
fi
# The primary prompt string, printed before a command is read.
-PS1="${system_emoji}${emoji_spacing} $(ax_logname_prompt_yn)$(ax_hostname_prompt_yn)%B%2~%b"'$(ax_vcs_prompt)'"$(ax_prompt)"
+PS1="${system_emoji}${emoji_spacing} $(axzsh_logname_prompt_yn)$(axzsh_hostname_prompt_yn)%B%2~%b"'$(axzsh_vcs_prompt)'"$(axzsh_prompt)"
# Default execution trace prompt.
PS4="$fg_no_bold[yellow]->$reset_color "
ZSH_THEME_PROMPT_SUFFIX_SPACING=" "
-PS1="%{$fg_bold[green]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%~%{$reset_color%}"'$(ax_vcs_prompt)'"$(ax_prompt)"
+PS1="%{$fg_bold[green]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%~%{$reset_color%}"'$(axzsh_vcs_prompt)'"$(axzsh_prompt)"
# ohmyzsh.axzshtheme: OhMyZSH "robbyrussell" theme
ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)"
-PS1='${ret_status} %{$fg[cyan]%}%c%b $(ax_vcs_prompt)%b '
+PS1='${ret_status} %{$fg[cyan]%}%c%b $(axzsh_vcs_prompt)%b '
ZSH_THEME_VCS_PROMPT_PREFIX_SPACING="%{$fg_bold[blue]%}vcs:("
ZSH_THEME_VCS_PROMPT_PREFIX="%{$fg[red]%}"