Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: source ~/dir/*.zsh
- X-seq: zsh-users 17156
- From: René Neumann <lists@xxxxxxxxx>
- To: TJ Luoma <tj@xxxxxx>
- Subject: Re: source ~/dir/*.zsh
- Date: Fri, 22 Jun 2012 10:18:53 +0200
- Cc: Zsh-Users List <zsh-users@xxxxxxx>
- In-reply-to: <-1148869711641803316@unknownmsgid>
- 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
- References: <-1148869711641803316@unknownmsgid>
Am 22.06.2012 02:01, schrieb TJ Luoma:
> I have split my .zshenv into a bunch of different files which all end
> with different suffixes. For example, functions are called "foo.f.zsh"
> or "bar.f.zsh"
>
> My idea was to put them all into a special directory and then source
> them like so in ~/.zshenv
>
> source ~/dir/*.f.zsh
A file bla.f.zsh contains exactly the function
bla ()
{
# bla_content
}
?
If so: just put all functions in a single dir (say ~/.zsh/functions/).
And there into a file 'bla' you put just "# bla_content", i.e. you omit
the function definition.
Then via
typeset -U path fpath
fpath=(~/.zsh/functions $fpath)
# load all things in there
autoload ${fpath[1]}/*(:t)
you have all you wanted :)
Sorry, if this description is confusing -- see here [1] for the official
documentation on this feature.
- René
[1] http://zsh.sourceforge.net/Doc/Release/Functions.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author