summaryrefslogtreecommitdiffstats
path: root/.zsh/rc/15prompt
diff options
context:
space:
mode:
Diffstat (limited to '.zsh/rc/15prompt')
-rw-r--r--.zsh/rc/15prompt10
1 files changed, 9 insertions, 1 deletions
diff --git a/.zsh/rc/15prompt b/.zsh/rc/15prompt
index c972c8a..5eb75ec 100644
--- a/.zsh/rc/15prompt
+++ b/.zsh/rc/15prompt
@@ -19,6 +19,9 @@ prompt_eof_setup() {
prompt_eof_setup "$@"
+
+
+
# function to show the current git branch in prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
@@ -27,10 +30,15 @@ parse_git_branch() {
#--------------------
# Prompt
#--------------------
-#PS1="[${fg_cyan}%*${fg_no_colour}] - ${fg_light_red}$USERNAME${fg_no_colour} ${fg_light_blue}%~${fg_no_colour} > "
+# necessary if you want to use functions in the prompt
+# without this they wouldn't be run again
+precmd () {
+# this has to be on the edge or you have some spaces in the prompt
+# if you have any workaround please tell
PS1="${fg_light_red}$USERNAME${fg_no_colour}@${fg_light_green}%m${fg_no_colour} \
- ${fg_light_blue}%~${fg_no_colour} ${fg_purple}$(parse_git_branch)${fg_no_colour}
[${fg_cyan}%*${fg_no_colour}] > "
+}
## Spelling prompt
SPROMPT='zsh: correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) '