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

Re: howto avoid ~irc in %~ ?



In the last episode (Jun 21), Andy Spiegl said:
> Hi Bart and Wayne,
> 
> I was really surprised to read this:
> > > Zsh doesn't do this all by itself.  You must at some point have used ~irc
> > > before zsh would add an entry for irc to its hash table of named dirs.
> because I never use ~irc.
> 
> But Waynes comment explains it: 
> > Completing ~ names will also add it for you.  For instance, if I type
> > "~w<TAB>" and get "~wayne", all other user home dirs have now been
> > cached.
> 
> So I guess there is no way to avoid ~irc to appear instead of /var.
> Hm, unless I remove it from the cache.  But how would I do that???

How about

chpwd() { unhash -d irc }

This lets you still use ~irc if you want, but by the time zsh gets
around to parsing %~, it'll be out of the hash.

-- 
	Dan Nelson
	dnelson@xxxxxxxxxxxxxxx



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