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

Re: Wishlist for zsh: 3 tcsh features



James F. Hranicky wrote:

> 
> I've been a happy user of zsh for a few years now, but there's 3
> features
> from tcsh that I'd love to either know how to enable or know how to add
> to zsh:
> 
> 	1) <Meta-Del>: In tcsh, when deleting elements in a path, 
> 	   <Meta-Del> generally deletes everything up to the next
> 	   "/" character, e.g.

I'm using the following clumsy but working solution.
Suggestions are welcome.


# Delete range of characters: from the first after last slash to EOL
# If the range is empty, remove '/' and invokes itself again
function clear-until-slash () {
 local x0=$CURSOR
 zle -U /
 zle vi-find-prev-char-skip
 local x1=$CURSOR
 [ $x1 -eq 0 ] && { zle beep; return; }
 if [ $x0 -eq $x1 ]; then
  zle backward-delete-char
  clear-until-slash
 fi
 RBUFFER=""
}

zle -N clear-until-slash
bindkey "\ew" clear-until-slash


-- 
Emacs is a nice OS - but it lacks a good text editor.
That's why I am using Vim.
	--Anonymous



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