robbyrussell/oh-my-zsh — pull request #2401 by LFDM (2014-01-05 01:13:45+00:00)
Title: Refactor of init script

This arose out of #2295 and #2113.

A completely refactored oh-my-zsh script. This works on top of the commits I mentioned in #2295 and also the commit of #2113. (read first)

It's basically a big clean up, that shouldn't really break anything - it works almost completely the same, just tidier.
- Wraps each step up in an own function, which makes the code more self documenting.
- Refactored out all duplication
- Checking twice for plugins erased. The plugin names are expanded to their full plugin path now just once, whether it resides in the custom or the default directory. They are stuffed in a variable which is reused (check comment starting on line 8).
- Using variables instead of writing the paths out 4 times on 4 lines.
- Sourcing of files wrapped in a function.
- Deletes the addition of $ZSH/functions and $ZSH/completions to fpath - those two directories do no exist (any more?)
- Fix of #2342 is applied.

Breaking changes:
- Plugins are only changed against the *.plugin.zsh naming convention, the variant with underscore is not checked. If that breaks plugins shipped with oh-my-zsh, I will change their names.
- Custom themes have to be in a themes folder and not at the top level of the custom dir - as it would be documented in the wiki text I wrote.
- I don't think both deprecated options are widely used anyway, but I could be wrong.

Proposal:
- Adding a changelog file, that is displayed in upgrade.sh. It might not have to all complete at all times, but in case any relevant changes are merged in, this could be a good place to inform people about was might affect them after upgrading.

Probably controversial:
- The file is mildly converted to zsh syntax. I think it's safe to assume that people will use zsh when they source this file :). Can be reverted back in a single step, however, I placed a symbolic link to avoid breaking backward compatibility. People sourcing oh-my-zsh.sh in their .zshrc will be redirected to the new oh-my-zsh.zsh file.

A question left:
- Could someone check the message of my last commit 7e79ed795f9d392de460efc87d1a787e2400eee7? It's regarding adding the plugin paths to fpath. The refactor does now exactly as the former script, but I am actually not sure that it's needed. Can someone explain this?

If people want to dig in further how oh-my-zsh works, this will be the file they first look at - it's easier to get an overview this way IMO.

Curious to hear your opinions.