Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
bug with camel case and delete-whole-word-match function
- X-seq: zsh-workers 38795
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: bug with camel case and delete-whole-word-match function
- Date: Tue, 5 Jul 2016 09:08:46 +0000 (UTC)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1467709896; bh=FynXMEhedoq1Wmf3K3HB4ZtYud9vrY43WnDcS7jAqZo=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=QdZcaQ77iP6vCQ0h3srPCMnUzZyj0vwHq3gp51DGX2Igt8384ku50P8JxH7uJbx6FI1Q7TpXKp7F/5sgSJjlc2gWi1YUqUk6MDFq0irKNDGl/GYtpkSDgmONop1lNN2PcHStnYTHZzfzkd7ohnEIS/TFd2gqZ9QDE3KQ8W7OMlgZu326cykEIDhex0vt3mt4/TiFCD3W1dSE7XjH8qsJuHlBVeWUqF4mxhL/3e+VfcLTLZ9Iw99pUo6IwQMHKuxIwwsoX0fiQldWN5vreMDdpoApRGCe2LasrRaSwZs4blEBD21Cz+9BrHHQ1HJY2gUGsxGxFRz3UnBAdtjqcpz4cw==
- 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: <588168129.3340906.1467709726474.JavaMail.yahoo.ref@mail.yahoo.com>
- Reply-to: Oliver Kiddle <okiddle@xxxxxxxxxxx>
I took a look at the word style widgets in the contributed functions with a view to perhaps adding a vim style text object based on them.
delete-whole-word-match appears to be the most useful example because it operates on a whole word rather than just forward of backward. Unfortunately, it doesn't seem to work too well for the subword (camel case) word style.
The presence of white space before the cursor position is used as an indication that the cursor is on the first character of the word but
with camel case, there isn't necessarily any whitespace.
Perhaps I'm missing something in the configuration but I have:
autoload -U delete-whole-word-match
zle -N delete-whole-word-match
zstyle ':zle:*' word-style normal-subword
bindkey '^K delete-whole-word-match
On the first character of a camel case word, both the current and previous word are deleted. On the last letter, it deletes up to the next real whitespace.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author