zsh-users
 help / color / mirror / code / Atom feed
* Loading functions
@ 2012-04-19 23:03 Mark
  2012-04-20  9:01 ` Christoph (Stucki) von Stuckrad
  0 siblings, 1 reply; 3+ messages in thread
From: Mark @ 2012-04-19 23:03 UTC (permalink / raw)
  To: zsh-users

Hello again fellow zshians,

For a particular git repository I created some helper functions.
Usually I cd to the gitroot and then I load these functions (and env
variables) by sourcing './zsh.env.' 

Often I forget to source the file and I also just dislike to source it
manually. I probably got irritated by this irritating pattern of first
forgetting to source the file, then forgetting to preface it with it's
path by typing ". zsh.env" and only then getting it right by typing
".  ./zsh.env".

After being properly annoyed in today's fourth or fifth terminal screen
i started to search for alternative ways. At first I thought I could
execute some script instead of sourcing it. But I couldn't find ways in
which my shell would remember specified functions after the script had
been executed. Is this even possible?

Then I realised that ideally my shell would "do something" (e.g.
automatically load functions, set env vars) when I go into a directory
or any subdirectory and "undo" it (unload these functions, unset the
variables) upon leaving the directory. Which ultimately leads to my next
question: can zsh be instructed to have a particular environment that is
local to certain directories?

Thank you,
-Mark.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-20  9:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 23:03 Loading functions Mark
2012-04-20  9:01 ` Christoph (Stucki) von Stuckrad
2012-04-20  9:51   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).