function fish_reload --description 'Re-source fish init: config.fish, conf.d, functions and completions' set -l fish_dir ~/.config/fish # conf.d + config.fish for file in $fish_dir/conf.d/*.fish source $file end source $fish_dir/config.fish # Erase autoloaded functions so they reload from disk on next use for file in $fish_dir/functions/*.fish functions -e (path change-extension '' (path basename $file)) 2>/dev/null end # Reload completions for file in $fish_dir/completions/*.fish complete -e -c (path change-extension '' (path basename $file)) 2>/dev/null source $file end # Re-run key bindings functions -q fish_user_key_bindings; and fish_user_key_bindings set_color green echo 'fish config reloaded' set_color normal end