Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Mimicking tcsh line-editing behavior
- X-seq: zsh-users 14218
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Rhyme Tan <rhymetan@xxxxxxxxxxxxxx>
- Subject: Re: Mimicking tcsh line-editing behavior
- Date: Thu, 2 Jul 2009 23:02:39 -0700
- Cc: zsh-users@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=d200902; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=Z7CVTDnQaw8eXYLJkw2ZiKeIKpFdrw1WT7zRviFfPWvdl9V4Wr4LVDcT5lJFJp53YhzgaxIG07lEX81mwsymcByhKK8J5QW5krVZ8XIf7CR3U/bCDCE3voSvhM3RW3sYQl0Gm+3GShwQQRusZYgIrDqx1x6zeW1ckWioyBf4nIg=;
- In-reply-to: <198303.88532.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Rhyme Tan <rhymetan@xxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <198303.88532.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
On 2009-07-02 at 19:46 +0000, Rhyme Tan wrote:
> My default shell is tcsh. In tcsh I can use alt(meta)-backspace, alt-F
> or alt-B to delete, or move forward or backward through a path.
>
> For example I type:
>
> ls /An/Example/of/a/Path/Name/
>
> To delete Path/Name/, I simply hold down the alt key and press
> backspace twice (alt-backspace x2). This will leave me with the path
> "/An/Example/of/a/". I cannot do this in zsh because
> pressing alt-backspace will delete the whole path (that is,
> "/An/Example/of/a/Path/Name/"). Is there some magic config
> option I can pass to zsh to duplicate the behavior of alt-backspace,
> -F, or -B) in tcsh?
So I started to write this, then grep'd my config to look for an example
and saw that I'd already written it once before, in the same way, just
with a differently named function for the widget and bound differently.
----------------------------8< cut here >8------------------------------
function backward-kill-partial-word {
local WORDCHARS="${WORDCHARS//[\/.]/}"
zle backward-kill-word "$@"
}
zle -N backward-kill-partial-word
bindkey '^Xw' backward-kill-partial-word
----------------------------8< cut here >8------------------------------
I think that I'll bind that to ESC-Backspace too, that way I might
remember that I have it. :-/ Sheesh, I only wrote it four months ago
and forgotten already.
Regards,
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author