wbingli / zsh-wakatime

ZSH plugin for wakatime
MIT License
152 stars 15 forks source link

Support for Prezto #12

Open haggen opened 8 years ago

haggen commented 8 years ago

Is it possible to use this plugin (maybe with a few changes) with prezto?

wbingli commented 8 years ago

I suppose you can simply use it as a module in prezto, probably changing a script name by prezto convention.

haggen commented 8 years ago

This:

precmd_functions+=(send_wakatime_heartbeat)

Had to be changed to:

add-zsh-hook precmd send_wakatime_heartbeat

Also the script has to be named init.zsh, and the directory must live in ~/.zprezto/modules/.

I'm not very proficient with zsh but I manage to get it working after these changes.

wbingli commented 8 years ago

Thanks. It used to add-zsh-hook precmd send_wakatime_heartbeat but change to precmd_functions+=(send_wakatime_heartbeat) due to add-zsh-hook doesn't work in none OS X platform.

I would create a new repo just for prezto.

haggen commented 8 years ago

I'm actually using OS X El Capitan and it's working with add-zsh-hook.

wbingli commented 8 years ago

yes, the add-zsh-hook on OS X is ok, but looks not work in other platforms like ubuntu, I haven't investigated to see why. I'm using OS X so little bit lazy to do so.

Actually I don't know why precmd_functions doesn't work for prezto, as basically the add-zsh-hook is just a nicer method to produce precmd_functions and others.