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

Re: Accidently wrote a command in CAPS LOCK



zzapper wrote:
> I was hoping for a history modifier eg
> ^^^ or !!:s///
> but they don't seem to support wildcards?

You should have said that earlier...

!!:l

will turn the whole previous line into lower case.  Do you only want a
certain range of words?  You can do tricks like:

% ECHO THIS NEXT WORD IS UPPERCASE
zsh: command not found: ECHO
% !!:-:l !!:$
% echo this next word is UPPERCASE

The word selector - is short for 1- which is short for 1 to the word
before the last.  The word selector $ is the last word.  So you get all
but the last word in lower case, then the next word as it was.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php



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