really enable (hardly possible to really disable)

This commit is contained in:
ncanceill 2014-04-05 20:41:42 +02:00
commit 509e42b422
2 changed files with 14 additions and 6 deletions

View file

@ -78,7 +78,7 @@ _disable_plugin() {
} }
_populate_enabled_plugins() { _populate_enabled_plugins() {
for plugin ($(_list_pre_enabled_enabled_plugins)); do for plugin ($@); do
if [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then if [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then
fpath=($ZSH/plugins/$plugin $fpath) fpath=($ZSH/plugins/$plugin $fpath)
source $ZSH/plugins/$plugin/$plugin.plugin.zsh source $ZSH/plugins/$plugin/$plugin.plugin.zsh
@ -95,6 +95,14 @@ _populate_enabled_plugins() {
_populate_enabled_theme() { _populate_enabled_theme() {
ZSH_THEME=$(_map_get themes theme) ZSH_THEME=$(_map_get themes theme)
# Reload theme (copied from oh-my-zsh.sh)
if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
else
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi
} }
_update_plugin() { _update_plugin() {
@ -122,4 +130,4 @@ _update_theme() {
_pre_enable_plugins _pre_enable_plugins
_populate_enabled_plugins _populate_enabled_plugins
_init_theme _init_theme
_populate_enabled_theme _populate_enabled_theme $(_list_pre_enabled_enabled_plugins)

View file

@ -31,7 +31,7 @@ omz () {
_list_plugins|less _list_plugins|less
;; ;;
(on) (on)
_enable_plugin "$3" _enable_plugin "$3"&&_populate_enabled_plugins "$3"
;; ;;
(off) (off)
_disable_plugin "$3" _disable_plugin "$3"
@ -40,7 +40,7 @@ omz () {
_update_plugin "$3" _update_plugin "$3"
;; ;;
(get) (get)
_download_plugin "$3" "$4" _download_plugin "$3" "$4"&&_populate_enabled_plugins "$4"
;; ;;
(-h|--help|help) (-h|--help|help)
echo $usage_p echo $usage_p
@ -57,13 +57,13 @@ omz () {
_list_themes|less _list_themes|less
;; ;;
(set) (set)
_enable_theme "$3" _enable_theme "$3"&&_populate_enabled_theme
;; ;;
(up) (up)
_update_theme "$3" _update_theme "$3"
;; ;;
(get) (get)
_download_theme "$3" "$4" _download_theme "$3" "$4"&&_populate_enabled_theme
;; ;;
(-h|--help|help) (-h|--help|help)
echo $usage_t echo $usage_t