aboutsummaryrefslogtreecommitdiff
path: root/dot_config/zsh/executable_prompts
diff options
context:
space:
mode:
Diffstat (limited to 'dot_config/zsh/executable_prompts')
-rw-r--r--dot_config/zsh/executable_prompts24
1 files changed, 24 insertions, 0 deletions
diff --git a/dot_config/zsh/executable_prompts b/dot_config/zsh/executable_prompts
new file mode 100644
index 0000000..93be077
--- /dev/null
+++ b/dot_config/zsh/executable_prompts
@@ -0,0 +1,24 @@
+#echo "Loading prompts..."
+# Some simple prompts
+#PS1='%n@%m %~ $ '
+#PS1='%F{green}%n@%m%f %F{blue}%~ $%f '
+
+# Autoload zsh add-zsh-hook and vcs_info functions (-U autoload w/o substition, -z use zsh style)
+autoload -Uz add-zsh-hook vcs_info
+# Enable substitution in the prompt.
+setopt prompt_subst
+# Run vcs_info just before a prompt is displayed (precmd)
+precmd_vcs_info() { vcs_info }
+precmd_functions+=( precmd_vcs_info )
+# Enable checking for (un)staged changes, enabling use of %u and %c
+zstyle ':vcs_info:*' check-for-changes true
+# Set custom strings for an unstaged vcs repo changes (*) and staged changes (+)
+zstyle ':vcs_info:*' unstagedstr ' *'
+zstyle ':vcs_info:*' stagedstr ' +'
+# Set the format of the Git information for vcs_info
+zstyle ':vcs_info:git:*' formats '(%b%u%c)'
+zstyle ':vcs_info:git:*' actionformats '(%b|%a%u%c)'
+
+PROMPT='%F{white}[ %n%F{red}@%F{white}%m ] %{$fg_bold[cyan]%}%~%{$reset_color%} ${vcs_info_msg_0_}'$'\n''%(?:%F{green}>%F{white} :%F{red}[%?] >%F{white} )'
+
+#echo "Prompts loaded"