]> arthur.barton.de Git - ax-zsh.git/blobdiff - ax.zsh
Add "00-newline" plugin
[ax-zsh.git] / ax.zsh
diff --git a/ax.zsh b/ax.zsh
index 197c5f0928a0da84d4aa8ded8a9028f5e78082a2..23eda0166f99d31368b2f0e19cec0de2f5acaef1 100644 (file)
--- a/ax.zsh
+++ b/ax.zsh
@@ -7,7 +7,7 @@ script_type="$script_name[2,-1]"
 # Handle "initialization stage", load all plugins of that stage, either from an
 # existing cache file or individually, optionally creating the cache.
 # - $1: Script name
-# - $2: Stage name (zprofile, zshrc, zlogin, zlogout)
+# - $2: Stage name (ax-io, zprofile, zshrc, zlogin, zlogout)
 function axzsh_handle_stage {
        name="$1"
        type="$2"
@@ -101,7 +101,7 @@ function axzsh_load_plugin {
 
        if [[ ! -r "$fname" && "$type" == "zshrc" ]]; then
                zsh_themes=("$dname/"*.zsh-theme(NY1))
-               if [[ -r "$dname/$plugin.zprofile" || -r "$dname/$plugin.zlogout" ]]; then
+               if [[ -r "$dname/$plugin.ax-io" || -r "$dname/$plugin.zprofile" || -r "$dname/$plugin.zlogout" ]]; then
                        # Native AX-ZSH plugin, but for different stage. Skip it!
                        :
                elif [[ -r "$dname/${plugin_short}.plugin.zsh" ]]; then
@@ -201,6 +201,25 @@ if [[ -z "$AXZSH" ]]; then
        fi
 fi
 
+if [[ "$script_type" = "zprofile" ]]; then
+       # Load all "output" plugins first, that is, before the "zprofile stage":
+       axzsh_handle_stage "$script_name" "ax-io"
+fi
+
+# Look for some 3rd-party integrations ...
+
+# --- Powerlevel10k ---
+# Read in Powerlevel10k configuration file, if not already read:
+[[ -z "$POWERLEVEL9K_CONFIG_FILE" && -r ~/.p10k.zsh ]] && source ~/.p10k.zsh
+# Enable instant prompt. Should stay close to the top of ~/.zshrc.
+# Initialization code that may require console input (password prompts,
+# [y/n] confirmations, etc.) must be executed before this, so all ax-zsh
+# plugings should do output in their "zprofile" stage!
+if [[ "$script_type" == "zprofile" ]]; then
+       p10k_instant_prompt="${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
+       [[ -r "$p10k_instant_prompt" ]] && source "$p10k_instant_prompt"
+fi
+
 axzsh_handle_stage "$script_name" "$script_type"
 
 # Clean up ...