Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Prompt formatting tricks for cut-and-paste
- X-seq: zsh-users 15324
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Prompt formatting tricks for cut-and-paste
- Date: Tue, 24 Aug 2010 08:07:44 -0700
- In-reply-to: <AANLkTikuH91W+P4bWKTEVzW=gtBZQfPwDJQphKyy=mz1@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTikuH91W+P4bWKTEVzW=gtBZQfPwDJQphKyy=mz1@xxxxxxxxxxxxxx>
On Aug 24, 3:48pm, Mikael Magnusson wrote:
}
} % zsh -f
} % autoload compinit
} % compinit -D
} % zmodload zsh/complist
} % bindkey '^F' menu-select
} % bindkey '^B' reverse-menu-complete
}
} (btw, I just realized after a couple of years if you do 'alias %=' in
} the zsh -f you can paste things like these more easily).
That works if you use an extremely simple prompt that can be aliased.
You might want to use
alias %=' '
so that the next word (the real command) is also alias-expanded. Not so
important when testing with zsh -f ...
Another similar trick is to have your more complex prompt begin with ":"
and end with ";", so you get things that look like
: user@host; bindkey '^F' menu-select
: user@host; bindkey '^B' reverse-menu-complete
If you combine that with coloring or %B/%b so the prompt stands out,
there's little loss of readability. You still have to avoid using
glob or redirect characters in the prompt (unless you also throw in
quotes, but then you're wasting 5+ characters on the trick).
Note you probably want to fix up at least PS2 in a similar way.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author