Enable conf.d loading for themes (#713)

Loading of conf.d files for the current theme is done after all other initialisation to ensure that everything the files need is loaded.
This commit is contained in:
Benedict Lee 2019-07-23 13:20:52 +08:00 committed by Derek W. Stavis
parent affb0b144b
commit c8337b654e
2 changed files with 10 additions and 0 deletions

View File

@ -48,4 +48,9 @@ end
emit perf:timer:start "Oh My Fish init user config path" emit perf:timer:start "Oh My Fish init user config path"
require --no-bundle --path $OMF_CONFIG require --no-bundle --path $OMF_CONFIG
emit perf:timer:finish "Oh My Fish init user config path" emit perf:timer:finish "Oh My Fish init user config path"
# Load conf.d for current theme if exists
set -l theme_conf_path {$OMF_CONFIG,$OMF_PATH}/themes*/$theme/conf.d
for conf in $theme_conf_path/*.fish
source $conf
end
emit perf:timer:finish "Oh My Fish initialisation" emit perf:timer:finish "Oh My Fish initialisation"

View File

@ -37,6 +37,11 @@ function omf.theme.set -a target_theme
and test -e $OMF_CONFIG/key_bindings.fish -o -e $OMF_PATH/key_bindings.fish and test -e $OMF_CONFIG/key_bindings.fish -o -e $OMF_PATH/key_bindings.fish
and __fish_reload_key_bindings and __fish_reload_key_bindings
# Load target theme's conf.d files
for conf in {$OMF_CONFIG,$OMF_PATH}/themes/$target_theme/conf.d/*.fish
source $conf
end
# Persist the changes # Persist the changes
echo "$target_theme" > "$OMF_CONFIG/theme" echo "$target_theme" > "$OMF_CONFIG/theme"