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

Re: Named directories



=?ISO-8859-1?Q?Mika_Sepp=E4nen?= wrote:
> Hi all,
> 
> If my homedir is /home/foo and I have named directory:
> 
> work=/home/foo/bar
> 
> Then if I switch to that dir (cd work), %~ expands to ~/bar. Is there
> any way to make it expand to ~work?

You need to refer to "~work" at least once; the usual trick is to put

: ~work

in your .zshrc after defining the directory.  You can also "setopt
autonamedirs" to make all such parameters eligible for this
replacement.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



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