cdgit: cd relative to git workdir root
valodim at mugenguild.com
Thu Sep 19 14:45:21 CEST 2013
I wrote a script a while ago which uses information from zsh's vcs_info
to maintain the root of a repository in the cdpath as long as you're in
the dir. Works with any vcs supported by vcs_info.
If you are not familiar with cdpath, it's an array in zsh which allows
specifying more paths for cd to look in for candidates to change the
working directory to. And since it's a built-in thing, you get
integration with cd and completion for free :)
This requires a prompt which calls vcs_info, since it is implemented as
a hook. The script should be self-contained and work by just sourcing it.
If you can't get it to work, setting this style
zstyle ':vcs_info:*' debug true
might help to check if the hook is called properly.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: Digital signature
More information about the vcs-home