Tarrasch / antigen-hs

A fast zsh plugin manager
MIT License
206 stars 21 forks source link

Support subdir and loading strategy #13

Closed Tarrasch closed 9 years ago

Tarrasch commented 9 years ago

This superceeds #11

Tarrasch commented 9 years ago

Would you like to review this @willghatch ? I guess you don't know enough Haskell to review that part, but what do you think about the syntax that is used in the README?

willghatch commented 9 years ago

This looks pretty good (significantly better than my patch), though I think a sourcing strategy that just sources the given path would be a good addition (maybe something like sourceFileDirectlyStrategy... only maybe shorter), though the only things I can think of right now that would need this are themes that are put together in the same directory. Antigen can take a full file path (albeit that's because I sent Antigen's author some pull requests too).

An example plugin that I use that doesn't adhere to the standard (just FYI since you didn't find any) is https://github.com/alfredodeza/zsh-plugins/vi/zle_vi_visual.zsh. I'm also working on some plugins that I dug out of my .zshrc that I've been gradually cleaning up (I don't always bother with good coding and generality in my own dotfiles...). I plan on splitting most of them up, but some of them have a common base, so I've been thinking I might just leave them in one repository, rather than creating inter-repository dependencies.

At any rate, thanks for adding this feature. I appreciate it.

Tarrasch commented 9 years ago

Hi again @willghatch,

Awesome, thanks for the sample plugin. I used it in my examples. What do you think about the interface I added in the new commit?

Hehe, sorry for the long variable names, but I just can't stand config files that are not explicit, what if you visit them again a year later? Besides, since we're in Haskell land, you can super-easily create any helper you want in MyAntigen.hs

willghatch commented 9 years ago

Nice, I think it's great.

Tarrasch commented 9 years ago

Ah, I forgot to update the FAQ in the README. Nevermind, I'll do that later.

Glad that you liked it, please try it out and let me know if you still like it ^^

willghatch commented 9 years ago

Ok, my dotfiles submodule has now switched from using my remote to yours, and it's working great. This added all the features I wanted. The only upgrade that I can think of now is to allow other sources than github. But I don't know of any plugins that live outside of github right now. Oh, it could also reference the environment variable to set its output directory. Then $HOME can have one less silly directory lurking about. But that's a small thing.

Tarrasch commented 9 years ago

Cool, I'm not up for creating the non-github flexibility until I see at least one use case.[*] As for using the environment variable, I'm up for implementing that since I find the use case quite valid (I've also thought about cleaning the result of ls ~). Would you mind creating a small issue for it? :)

Again, super happy that this made the plugin more usable for you. :)

[*] Actually you can already hack around it, something like (bundle "") { storage = GitRepository "any-git-cloneable-url" } (you must then add RepoStorage(..) to your imports list too).