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

Re: Comand-line editing



On Jan 19,  9:48am, Jesper Holmberg wrote:
}
} In Emacs, [kill-region] would be with C-w, but this is [kill-word] with
} the default bindings in zsh. How can I do this?

Do you mean, "How can I do this without re-binding C-w?"

	M-x kill-region RET

Do you mean, "How can I re-bind C-w to do this?"

	bindkey '\C-w' kill-region

It should be obvious how to bind some other key to kill-region.

Note that this may have some unexpected behavior, because the mark is
always implicitly set to the beginning of the current command line; so
if you've not typed C-space, kill-region acts like backward-kill-line.

The reason C-w is kill-word in the default bindings is for compatibility
with the default settings of the old BSD Unix TTY driver, but of course
GNU readline (hence bash) does the same, so it's probably too late to
change it now.

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