mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 13:50:09 +00:00
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
This commit is contained in:
parent
6fbfc4c78b
commit
2a3a940a45
1 changed files with 9 additions and 1 deletions
|
@ -23,5 +23,13 @@ function lstheme {
|
||||||
# Resources:
|
# Resources:
|
||||||
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers
|
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers
|
||||||
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers
|
# 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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue