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

Re: Is there a delete-to-previous-slash key?



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