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

bug with camel case and delete-whole-word-match function



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