diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2018-10-09 14:46:47 -0400 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2018-10-09 14:46:47 -0400 |
commit | 075160b86c64045e661209ad7906559068b44104 (patch) | |
tree | a910a6eef6163d39859395bb0b416b2b184db9ac /plugins/themes | |
parent | 5ece6ef2f07c58672a9c965dbbbb62a42386fb2d (diff) | |
parent | 3c9942c4884089b290ef750468b29419ca0de271 (diff) | |
download | zsh-075160b86c64045e661209ad7906559068b44104.tar.gz zsh-075160b86c64045e661209ad7906559068b44104.tar.bz2 zsh-075160b86c64045e661209ad7906559068b44104.zip |
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/themes')
-rw-r--r-- | plugins/themes/README.md | 18 | ||||
-rw-r--r-- | plugins/themes/themes.plugin.zsh | 10 |
2 files changed, 24 insertions, 4 deletions
diff --git a/plugins/themes/README.md b/plugins/themes/README.md new file mode 100644 index 000000000..408e357e0 --- /dev/null +++ b/plugins/themes/README.md @@ -0,0 +1,18 @@ +# Themes Plugin + +This plugin allows you to change ZSH theme on the go. + +To use it, add `themes` to the plugins array in your zshrc file: + +``` +plugins=(... themes) +``` + +## Usage + +`theme <theme_name>` - Changes the ZSH theme to specified theme. + +`theme ` - Changes the ZSH theme to some random theme. + +`lstheme ` - Lists installed ZSH themes. + diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh index 7519b0253..2cd0ee327 100644 --- a/plugins/themes/themes.plugin.zsh +++ b/plugins/themes/themes.plugin.zsh @@ -8,9 +8,9 @@ function theme source "$RANDOM_THEME" echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." else - if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] + if [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ] then - source "$ZSH_CUSTOM/$1.zsh-theme" + source "$ZSH_CUSTOM/themes/$1.zsh-theme" else source "$ZSH/themes/$1.zsh-theme" fi @@ -19,6 +19,8 @@ function theme function lstheme { - cd $ZSH/themes - ls *zsh-theme | sed 's,\.zsh-theme$,,' + # Resources: + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers + print -l {$ZSH,$ZSH_CUSTOM}/themes/*.zsh-theme(N:t:r) } |