Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is there a delete-to-previous-slash key?
- X-seq: zsh-users 9640
- From: Ian Langworth <ian.langworth@xxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: Is there a delete-to-previous-slash key?
- Date: Fri, 4 Nov 2005 13:11:28 -0500
- Cc: zsh-users@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TQovN5WAK5GRDrtSj0KtSy/SOInoagTBYzPLAZanrtvYAGCWnGzH1Ydvd0NLZI6lC9Z3bA7MWUppzFT3W0g6KzDnCkRpfpOZyq1P85VHrVH+PGuvGb04jleY8ET6Tvdd3rrniZZ5BKvnicu74DI2mKRl1q4nmztVTX1jabUjIWE=
- In-reply-to: <20051104180024.5db02beb.pws@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <b6c719b90511040927q5d0bbf44h2ad06a3925b7a45c@xxxxxxxxxxxxxx> <20051104180024.5db02beb.pws@xxxxxxx>
Thank you, Peter. I believe that your simplest example will suit me just fine.
On 11/4/05, Peter Stephenson <pws@xxxxxxx> wrote:
> Ian Langworth <ian.langworth@xxxxxxxxx> wrote:
> > I'd like to have a key that deletes leftwards from the cursor to the
> > previous occurrence of '/'. Does anyone have a snippet that does this
> > sort of thing, or shall I dig deeper into zle?
>
> The easiest way is temporarily not to allow / to be part of a word and
> use backward-delete-word:
>
> backward-delete-to-slash () {
> local WORDCHARS=${WORDCHARS//\//}
> zle .backward-delete-word
> }
> zle -N backward-delete-to-slash
--
Ian Langworth
Messages sorted by:
Reverse Date,
Date,
Thread,
Author