zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users <zsh-users@sunsite.dk>
Subject: Re: Prompt truncating, redux
Date: Sat, 01 Jul 2006 11:25:09 -0700	[thread overview]
Message-ID: <060701112509.ZM24578@torch.brasslantern.com> (raw)
In-Reply-To: <3E1F24BF-0332-4A29-9F54-5A3F0D24484E@petmystone.com>

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.


  reply	other threads:[~2006-07-01 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-01 15:35 Timothy Stone
2006-07-01 18:25 ` Bart Schaefer [this message]
2006-07-02 14:38   ` Timothy Stone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=060701112509.ZM24578@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).