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

Re: kill-word & friends in ZLE



On May 16,  1:02am, Hrvoje Niksic wrote:
} Subject: kill-word & friends in ZLE
}
} It is quite irritating for me that in zsh's Emacs mode functions like
} backward-kill-word and similar behave in a different fashion. Examples:
} 
} fly% cd /usr/local/lib/gwembljh[Esc-Backspace]
} 
} and everything is erased, instead of just gwembljh. The same applies for
} {backward,forward}-word.

An annoying effect of removing '/' from WORDCHARS is:

	diff -u /usr/tmp/foo
			    ^
			    With cursor here, press alt-backspace
			    four times.
	diff 
             ^
	     Cursor is now here.  I really didn't want to erase the -u,
	     just up through the slash.

My fingers just don't let go of the alt key automatically enough when I
get down to only the single slash.

If I switch to vi-backward-kill-word, then you have to press ctrl-W *six*
times to erase the whole path.  Using kill-word to erase a single slash
seems far too jerky, except when the slash is by itself.

What I really want is for the word-erase to treat a trailing slash (or
one all by itself) as part of a word, but to treat a leading or embedded
slash as a word boundary.

I'd settle for this:

	diff -u /usr/tmp/foo
			    ^
			    With cursor here, something-kill-word
			    leaves you with:
	diff -u /usr/tmp
			^
			Cursor here.  Two more kills leave:
	diff -u
	       ^
	       Cursor here.

I.e., consume the word *and* the non-word to its left, up to the end of
the previous word.  (The emacs behavior is to first kill the non-word
at the *right* and then kill the word.)  Its much easier to retype the
space or slash than to retype an entire accidentally-killed word.

Yes, I know this is neither emacs behavior nor vi behavior, but it would
be nice if there were some way it could be programmed.

Another satisifactory option would be something like "yank-word", so I
could yank back the most-recently-killed word, rather the whole line,
when I accidentally press alt-backspace once too often.

Oh, well, I'm just grumbling.

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern

New male in /home/schaefer:
>N  2 Justin William Schaefer  Sat May 11 03:43  53/4040  "Happy Birthday"




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