diff options
author | Marc Cornellà <marc.cornella@live.com> | 2020-03-23 22:50:06 +0100 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2020-03-23 22:51:48 +0100 |
commit | 2a3a940a4553a271d45722538697a667f9b55293 (patch) | |
tree | 1b34cdf7f2b119b12e2354a61ed54268a426df17 /plugins/themes | |
parent | 6fbfc4c78bc00f1bb6f583c250f4f89509782957 (diff) | |
download | zsh-2a3a940a4553a271d45722538697a667f9b55293.tar.gz zsh-2a3a940a4553a271d45722538697a667f9b55293.tar.bz2 zsh-2a3a940a4553a271d45722538697a667f9b55293.zip |
themes: change lstheme function to themes in $ZSH_CUSTOM in any level
Also sort and remove duplicates, and pipe to fmt to improve output format.
Fixes #8755
Diffstat (limited to 'plugins/themes')
-rw-r--r-- | plugins/themes/themes.plugin.zsh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh index 1fbde5b64..cda83f587 100644 --- a/plugins/themes/themes.plugin.zsh +++ b/plugins/themes/themes.plugin.zsh @@ -23,5 +23,13 @@ function lstheme { # Resources: # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers - print "$ZSH_CUSTOM"/*.zsh-theme(N:t:r) {"$ZSH_CUSTOM","$ZSH"}/themes/*.zsh-theme(N:t:r) + { + # Show themes inside $ZSH_CUSTOM (in any subfolder) + # Strip $ZSH_CUSTOM/themes/ and $ZSH_CUSTOM/ from the name, so that it matches + # the value that should be written in $ZSH_THEME to load the theme. + print -l "$ZSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::) \ + + # Show themes inside $ZSH, stripping the head of the path. + print -l "$ZSH"/themes/*.zsh-theme(.N:t:r) + } | sort -u | fmt -w $COLUMNS } |