zshrc: New prompt: Register prompt theme with promptsys
authorFrank Terbeck <ft@grml.org>
Mon, 4 Mar 2013 18:20:46 +0000 (19:20 +0100)
committerFrank Terbeck <ft@grml.org>
Tue, 5 Mar 2013 17:21:59 +0000 (18:21 +0100)
This requires a little more care, since promptinit only picks up
themes from $fpath; which we don't do. We define the prompt directly
in the zshrc file.

Signed-off-by: Frank Terbeck <ft@grml.org>
etc/zsh/zshrc

index 8829578..305155e 100644 (file)
@@ -1351,6 +1351,13 @@ function prompt_grml_precmd () {
 # set prompt
 if zrcautoload promptinit && promptinit 2>/dev/null ; then
     promptinit # people should be able to use their favourite prompt
+
+    # Since we define the required functions in here and not in files in
+    # $fpath, we need to stick the theme's name into `$prompt_themes'
+    # ourselves, since promptinit does not pick them up otherwise.
+    prompt_themes+=( grml )
+    # Also, keep the array sorted...
+    prompt_themes=( "${(@on)prompt_themes}" )
 else
     print 'Notice: no promptinit available :('
 fi