Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: directory specific functions and aliases

On Fri, 13 Feb 2015 10:05:21 -0500
shawn wilson <ag4ve.us@xxxxxxxxx> wrote:
> What would be the best way to make functions that do different things
> based on the directory I'm in - kinda like rvm does with rubies? I was
> hoping for something cleaner than: case $(pwd) This is mainly because
> I want to wrap cvs and rsync differently based on repo (and where
> within that repo).

I use a dot-file in the directory, but you need to be careful with this
--- at least check you own the file before using it for extracting
commands or anything of that kind.  You can easily search backward for a
file of the same name in a parent directory if you have EXTENDED_GLOB
set: (../)#.thatdotfilename which will allow you to put in the top level
of a repository.

In particular, I have a local history file that's searched for commands
if they match a certain pattern.  Integration with the main history file
sort of works but isn't as seamless as I'd like.


Messages sorted by: Reverse Date, Date, Thread, Author