aboutsummaryrefslogtreecommitdiff
path: root/zsh/.zsh/custom-prompt.zsh
diff options
context:
space:
mode:
authorxero <x@xero.nu>2015-03-07 20:49:16 -0500
committerxero <x@xero.nu>2015-03-07 20:49:28 -0500
commit37ef7b9e48d9a496c08540772a110b85aacac2e6 (patch)
tree90ca18509aa45ec523a550c3a6ad622ca2d627a4 /zsh/.zsh/custom-prompt.zsh
parent627c9813c7c95ea2e3d45de0e44bab4f17e78f51 (diff)
downloaddotfiles_ascii-37ef7b9e48d9a496c08540772a110b85aacac2e6.tar.xz
dotfiles_ascii-37ef7b9e48d9a496c08540772a110b85aacac2e6.zip
organize and modularize zsh configs
Diffstat (limited to 'zsh/.zsh/custom-prompt.zsh')
-rwxr-xr-xzsh/.zsh/custom-prompt.zsh40
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'