Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Prompt truncating, redux
- X-seq: zsh-users 10464
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: Prompt truncating, redux
- Date: Sat, 01 Jul 2006 11:25:09 -0700
- In-reply-to: <3E1F24BF-0332-4A29-9F54-5A3F0D24484E@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <3E1F24BF-0332-4A29-9F54-5A3F0D24484E@xxxxxxxxxxxxxx>
On Jul 1, 11:35am, Timothy Stone wrote:
}
} I figured out the expectations of zsh v. tcsh, save "set ellipsis"...
} zsh seems to be able to do this, but I can't sort out the syntax
} using '%<...<%/'
The ellipsis syntax in zsh truncates everything up to either the end
of the prompt or the next truncation marker. It also truncates at a
set number of characters, rather than (e.g.) a set number of directory
levels in a path hierarchy.
So you can say
%20<...<%/%<<
to get ellipsis followed by 20 characters of the tail of the path, but
that doesn't promise to show you three directories if the last one or
two are more than 20 characters long in total.
What you appear to want is conditional syntax, not truncation syntax:
%4(c:...:)%3c
will show elipses if %c is at least 4 path elements long, nothing if it
is less than 4 elements long, followed by the last 3 elements of %c.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author