Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: backward-kill-shell-word widget
- X-seq: zsh-workers 37542
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: backward-kill-shell-word widget
- Date: Sun, 10 Jan 2016 09:17:44 -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=+ahEeJaZukrH1rJ+234PdBKHXOg3kOoGJY/sZeQMwsE=; b=FrQecAWPzVFG79yoLLSKP/8Zor3DyvDw5NVmyNLHlMX5/W6sXA7PRxBMxu3DtyVd06 0r0d+RXcoQBs6PYa/UkEIZOAFu1EzxRFH3NCsvX6vAMp3iuHq7nSjFFi8iDAYB5HbF3m YsxjnHqFkgoCdMNf3tmwKDQIlEfYrrH7tnfVJxR22owQDfY6DgifzD426auJsD76+uPc oHlukbqxhO/9QjO48AVhcYww9q3LaSF0hKLtDpoijFcHAYr5MeVK/zFTwXtjEbq7x7ie sRZ4uvRldwn88pc79fKsoB7HYuunqkBbZ+0sDn7U/Dn2rRPwCGpBQp+CbTkXzxxruLz5 KLhg==
- In-reply-to: <20160110003758.GA28696@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>
On Jan 1, 12:37am, Daniel Shahaf wrote:
}
} This widget is like ^W but for "shell words" rather than
} whitespace-separated words, so
}
} % echo foo "bar baz" <CURSOR>^W
} becomes
} % echo foo <CURSOR>
As of 5.0.8 you can do this with:
backward-kill-shell-word() {
zle select-in-shell-word
((++CURSOR)) # adjust for vi vs. emacs region
zle kill-region
}
I'm not sure if that CURSOR adjustment is a a bug or just a necessary
evil because of using vi binding in the emacs keymap.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author