Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: backward-kill-shell-word widget
- X-seq: zsh-workers 37574
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: backward-kill-shell-word widget
- Date: Mon, 11 Jan 2016 23:54:09 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=M8zrXf/xhPozlQ/nsGgu+WyXcp8joHCV/lCJa/qjJ/I=; b=0JhkSooZuW46dL6XqskTalSPs1pD7w3gI7WrX/NzlXZ+7M1GYP4uFk9vfmfPAcGsHw lMb3ilbBI/4wgw+Aup6cG++oKN57miDKkTdmeIluYszewN9bRF1oqYJyXoP3SGloHs7n WdSzRxVOKJAqIIKdlqZAHb1qQgR8iRuLCAUfFBsCFQcvwmKO+JbPzmXOiw6KOiggJynn x9aoPpY8LWo5mYw4KF+7Je3urqHyEHwezgEPkOwm73XlmQ95CkiDZN6NU9yN0Z6HnvTF 93LNjPEKWVDhZpx9P4WoFOBj8Kh0MC5JBsFtWQ8auxoUa9M1zZDHmYWGTyyFtmEp5eIj puyQ==
- In-reply-to: <20160110195323.GA23064@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20160110003758.GA28696@tarsus.local2> <160110091744.ZM585@torch.brasslantern.com> <20160110195323.GA23064@tarsus.local2>
On Jan 10, 7:53pm, Daniel Shahaf wrote:
}
} Bart Schaefer wrote on Sun, Jan 10, 2016 at 09:17:44 -0800:
} >
} > backward-kill-shell-word() {
} > zle select-in-shell-word
} > ((++CURSOR)) # adjust for vi vs. emacs region
} > zle kill-region
}
} I'd add:
} LBUFFER+=" "
}
} Without that, LBUFFER[-1] after the widget is the last character of the
} preceding word.
If you don't kill the space, select-in-shell-word won't identify the
correct word on a repeated call.
Other problems I've noted with this approach are that multiple calls
add to the kill ring but do not append to CUTBUFFER, and that this
kills the whole word under the cursor not just the part to the left.
So it needs some work.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author