zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: How to stop dir expansion in the prompt?
Date: Mon, 03 Nov 2014 23:36:51 -0800	[thread overview]
Message-ID: <141103233651.ZM32506@torch.brasslantern.com> (raw)
In-Reply-To: <CAJQX3DzO+M4E7saUp1dBWGmrUYws3vYRASj=Bq2Euj7vRd6Qkg@mail.gmail.com>

On Nov 4,  2:30pm, Shiyao Ma wrote:
}
} To replace $HOME with ~, I do this:
} PROMPT="%(?.${success_color}.${failure_color})${SSH_TTY:+[%n@%m]}%B%${max_path_chars}<...<"'${${vcs_info_msg_0_%%}/#$HOME/~}'"%<<%(!.${root_char}.${user_char})%b%f
} "
} 
} Where am I doing wrong?

/#$HOME/ means the pattern has to match at the start of the string.
Are you sure the value of $vcs_info_msg_0_ starts with the directory
name?  Also, why is the %% in the inner expansion?  (I guess it was in
your original example too, but it's extraneous if there's nothing
between it and the closing brace.)

} (Does zsh support nested variable expansion?)

Yes.


  reply	other threads:[~2014-11-04  7:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  3:23 Shiyao Ma
2014-11-04  3:43 ` Bart Schaefer
2014-11-04  6:30   ` Shiyao Ma
2014-11-04  7:36     ` Bart Schaefer [this message]
2014-11-04  9:42       ` Shiyao Ma
2014-11-04 16:43         ` Bart Schaefer
2014-11-05  1:27           ` Shiyao Ma

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=141103233651.ZM32506@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /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).