zsh-users
 help / color / mirror / code / Atom feed
* Prompt formatting tricks for cut-and-paste
       [not found] <AANLkTikuH91W+P4bWKTEVzW=gtBZQfPwDJQphKyy=mz1@mail.gmail.com>
@ 2010-08-24 15:07 ` Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2010-08-24 15:07 UTC (permalink / raw)
  To: zsh-users

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-24 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AANLkTikuH91W+P4bWKTEVzW=gtBZQfPwDJQphKyy=mz1@mail.gmail.com>
2010-08-24 15:07 ` Prompt formatting tricks for cut-and-paste Bart Schaefer

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).