Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: directory specific functions and aliases
- X-seq: zsh-users 19867
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: directory specific functions and aliases
- Date: Fri, 13 Feb 2015 15:41:38 +0000
- In-reply-to: <CAH_OBicY5yU-qWELH1Qd6Mx=KZfKdhgnoagA_TurjXo5sCAp5w@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAH_OBicY5yU-qWELH1Qd6Mx=KZfKdhgnoagA_TurjXo5sCAp5w@mail.gmail.com>
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.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author