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

Re: How to stop dir expansion in the prompt?



Thanks.
Really a right direction.

I now set :
zstyle ':vcs_info:*' nvcsformats "%d" ""


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
"

But it doesn't work as if the replace never happened.
(Does zsh support nested variable expansion?)

Where am I doing wrong?


Regards

2014-11-04 11:43 GMT+08:00 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>:
> On Nov 4, 11:23am, Shiyao Ma wrote:
> }
> } If I cd to a directory like ~/.virtualenvs, the prompt will show as
> } ~WORKON_HOME.
> }
> } I wonder, is there a option to disable the auto expansion?
>
> That expansion is the %~ prompt replacement, so one way to avoid this
> is to change
>
>     zstyle ':vcs_info:*' nvcsformats "%~" ""
>
> to
>
>     zstyle ':vcs_info:*' nvcsformats "%2d" ""
>
> or similar.
>
> If this is unsatisfactory, you should
>
>     unsetopt AUTO_NAME_DIRS
>
> and possibly also
>
>     unsetopt CDABLE_VARS
>
> unless you are actually using those features.  There's no way to disable
> the action of %~ on named directories once a named directory entry is
> created.



-- 

吾輩は猫である。ホームーページはhttp://introo.me。;



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