Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Load theme after loading all libraries

By not loading the theme at the end of lib/appearance.zsh, but rather
after loading all libraries, a theme can rely on/override not just the basic
appearance stuff like PS1.
For example the 'dieter' theme intercepts (but does not alter) the accept-line
widget to change the display on the relevant keystroke.
Features like these are impossible or subject to race conditions without
this rearrangement.
  • Loading branch information...
commit 7ca0afd6861fe0c9e6903a08f0e469746df627e0 1 parent 1a673fc
@Dieterbe authored
Showing with 3 additions and 3 deletions.
  1. +0 −3  lib/appearance.zsh
  2. +3 −0 
3  lib/appearance.zsh
@@ -33,6 +33,3 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" # Text to display if the branch is c
# Setup the prompt with pretty colors
setopt prompt_subst
-# Load the theme
-source "$ZSH/themes/$ZSH_THEME.zsh-theme"
3 
@@ -7,6 +7,9 @@ fpath=($ZSH/functions $fpath)
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh) source $config_file
+# Load theme
+source "$ZSH/themes/$ZSH_THEME.zsh-theme"
# Load all of your custom configurations from custom/
for config_file ($ZSH/custom/*.zsh) source $config_file

3 comments on commit 7ca0afd


Wouldn't you want to load the theme after the customizations in $ZSH/custom/*.zsh were loaded? I submitted a similar pull request doing just that before I saw this one.



Not really, because in the custom files I can override theme behavior.
The used theme might not be written by me, and I might want to override certain stuff from it.


Understandable. I guess either I'm missing the purpose of custom, and should throw lots of what I put in there directly into a new lib, or this is just a chicken-and-egg problem inherent in the system.

Please sign in to comment.
Something went wrong with that request. Please try again.