]> arthur.barton.de Git - ax-zsh.git/blobdiff - core/50_prompt/50_prompt.zshrc
50_prompt: Implement some common functions as "dummies"
[ax-zsh.git] / core / 50_prompt / 50_prompt.zshrc
index 39c47a395956621058c77723ba06e2f1f6a4f90e..5869f060826af3d7e90f400355a1636574014ab0 100644 (file)
@@ -1,6 +1,11 @@
 # AX-ZSH: Alex' Modular ZSH Configuration
 # 50_prompt.zshrc: Setup default prompts
 
+# Some dummy functions (used by some OhMyZsh themes, for example) ...
+git_prompt_info(){ true; }
+git_prompt_status(){ true; }
+rvm_prompt_info(){ true; }
+
 # Logname ("user name")
 
 ZSH_THEME_LOGNAME_PROMPT_PREFIX_SPACING=""
@@ -27,7 +32,7 @@ function ax_logname_prompt_yn() {
        done
 }
 
-ax_logname_prompt_functions=()
+ax_logname_prompt_functions=(ax_logname_prompt_root)
 
 # Hostname
 
@@ -54,15 +59,23 @@ ax_hostname_prompt_functions=()
 
 # VCS
 
+if axzsh_is_utf_terminal; then
+       clean="✔"; dirty="✘"; ahead="→"; behind="←"
+else
+       clean="+"; dirty="x"; ahead=">"; behind="<"
+fi
+
 ZSH_THEME_VCS_PROMPT_PREFIX_SPACING="("
 ZSH_THEME_VCS_PROMPT_PREFIX="%{$fg_no_bold[yellow]%}"
 ZSH_THEME_VCS_PROMPT_SUFFIX="%{$reset_color%}"
 ZSH_THEME_VCS_PROMPT_SUFFIX_SPACING=")"
 
-ZSH_THEME_VCS_PROMPT_CLEAN=" %{$fg_no_bold[green]%}✔"
-ZSH_THEME_VCS_PROMPT_DIRTY=" %{$fg_no_bold[red]%}✘"
-ZSH_THEME_VCS_PROMPT_AHEAD="%{$fg_no_bold[cyan]%}→"
-ZSH_THEME_VCS_PROMPT_BEHIND="%{$fg_no_bold[blue]%}←"
+ZSH_THEME_VCS_PROMPT_CLEAN=" %{$fg_no_bold[green]%}$clean"
+ZSH_THEME_VCS_PROMPT_DIRTY=" %{$fg_no_bold[red]%}$dirty"
+ZSH_THEME_VCS_PROMPT_AHEAD="%{$fg_no_bold[cyan]%}$ahead"
+ZSH_THEME_VCS_PROMPT_BEHIND="%{$fg_no_bold[blue]%}$behind"
+
+unset clean dirty ahead behind
 
 function ax_vcs_prompt() {
        local func
@@ -98,6 +111,3 @@ function ax_prompt() {
 # Options and defaults
 
 setopt PROMPT_SUBST
-
-export PS1 PS2 PS3 PS4
-export RPS1 RPS2