diff options
Diffstat (limited to 'zsh/.zsh/custom-prompt.zsh')
-rwxr-xr-x | zsh/.zsh/custom-prompt.zsh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/zsh/.zsh/custom-prompt.zsh b/zsh/.zsh/custom-prompt.zsh new file mode 100755 index 0000000..495aa37 --- /dev/null +++ b/zsh/.zsh/custom-prompt.zsh @@ -0,0 +1,40 @@ +# ██ +# ░██ +# ██████ ██████░██ +# ░░░░██ ██░░░░ ░██████ +# ██ ░░█████ ░██░░░██ +# ██ ░░░░░██░██ ░██ +# ██████ ██████ ░██ ░██ +# ░░░░░░ ░░░░░░ ░░ ░░ +# +# ▓▓▓▓▓▓▓▓▓▓ +# ░▓ author ▓ xero <x@xero.nu> +# ░▓ code ▓ http://code.xero.nu/dotfiles +# ░▓ mirror ▓ http://git.io/.files +# ░▓▓▓▓▓▓▓▓▓▓ +# ░░░░░░░░░░ +# +#█▓▒░ colors for permissions +if [[ "$EUID" -ne "0" ]] +then # if user is not root + USER_LEVEL="%F{cyan}" +else # root! + USER_LEVEL="%F{red}" +fi + +#█▓▒░ allow functions in the prompt +setopt PROMPT_SUBST + +#█▓▒░ autoload zsh functions +fpath=(~/.zsh/functions $fpath) +autoload -U ~/.zsh/functions/*(:t) + +#█▓▒░ enable auto-execution of functions +typeset -ga preexec_functions +typeset -ga precmd_functions +typeset -ga chpwd_functions + +#█▓▒░ prepend git functions needed for prompt +preexec_functions+='preexec_update_git_vars' +precmd_functions+='precmd_update_git_vars' +chpwd_functions+='chpwd_update_git_vars' |