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

Re: ZLE Widget: Insert last word (except &)



On Jul 12, 12:05am, Vincent Lefevre wrote:
} Subject: Re: ZLE Widget: Insert last word (except &)
}
} On Tue, Jul 11, 2000 at 19:29:55 +0200, Christoph Lange wrote:
} >   I found it annoying that the widget insert-last-word inserts `&' if the
} > previous command was a background job. I'd rather like the last word
} > *before* `&' to be inserted.
} 
} Me too!

Presumably what you'd really rather is that the last non-separator word
is inserted.  Even with Christoph's widget, if you type "echo foo;" and
then invoke smart-insert-last-word you get ";" inserted.

} IMHO, this behavior should be in zsh as standard.

But there's more; "echo foo 2>&1" followed by {smart-,}insert-last-word
inserts "1", and prefixing it with ESC 2 inserts "2>&".

Or "(echo foo)", where the last word is ")".  What about "{ echo foo; }"
or the same suffixed with a redirection (inside or outside the braces)?

If we don't accept the shell syntax definition of a "word", how can we
choose a single definition of what constitutes a "word" that everyone
will agree on?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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