zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: <zsh-workers@zsh.org>
Subject: bug with camel case and delete-whole-word-match function
Date: Tue, 5 Jul 2016 09:08:46 +0000 (UTC)	[thread overview]
Message-ID: <588168129.3340906.1467709726474.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <588168129.3340906.1467709726474.JavaMail.yahoo.ref@mail.yahoo.com>

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


       reply	other threads:[~2016-07-05  9:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <588168129.3340906.1467709726474.JavaMail.yahoo.ref@mail.yahoo.com>
2016-07-05  9:08 ` Oliver Kiddle [this message]
2016-07-05 10:19   ` Peter Stephenson
2016-07-05 16:12     ` Bart Schaefer
2016-07-05 16:28       ` Peter Stephenson
2016-07-23 23:06     ` Oliver Kiddle
2016-07-24 19:44       ` Peter Stephenson
2016-07-26 13:52       ` Peter Stephenson
2016-07-26 18:22         ` Oliver Kiddle
2016-07-27  8:54           ` Peter Stephenson
2016-07-27 23:05             ` Oliver Kiddle
2016-07-26 15:51   ` Peter Stephenson
2016-07-26 16:00     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=588168129.3340906.1467709726474.JavaMail.yahoo@mail.yahoo.com \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).