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

Re: My zshrc; any sugestions welcome

On Mon, 25 Mar 2002, Joakim Ryden wrote:

> /home/jo/.zshrc:133: compinit: function definition file not found
> whereas just straight sourcing ~/.zshrc (not from the function)
> works fine. i'm sure i'm overlooking something stupid. any ideas
> anyone??

It's because `typeset -U path fpath ...' is executing inside the function
context and therefore turning all those arrays into local variables that
don't have their usual values.  I should have noticed this before.

There is no workaround for this using functions in zsh 3.0, so the `src'
function can't be used if the .zshrc is going to be read that version.
If only 4.0 will ever read it, you can change the call to typset to use
the -g option

	typeset -gU path fpath ...

and then all will be well.

Alternately, put the body of the `src' function in another file (called
for example `~/.zsh_reload') and then read *that* file with `source', e.g.

	alias src='source ~/.zsh_reload'

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