Hacker News new | ask | show | jobs
by mikojan 1606 days ago
I have never felt the need to visually confirm something as obvious as "delete 1 word".

On the other hand, you cannot do something like "delete 3 words" in kakoune. "3wd" just takes you to the third word and deletes that.

Deleting 3 words is definitely slower. And it's kind of infuriating...

What am I doing wrong?

1 comments

Lowercase w resets (each) selection to end of selection, skips any whitespace, and selects to next word boundary, so www or 3w will select third word counting from cursor. Uppercase W extends selection over any whitespace and then to next word boundary, so WWW or 3W will select from cursor to third end of word. (Most other movements are also in lowercase resetting / uppercase extending pairs.) Thus with length-1 (that is, initial-state) selection you can do wwwd or 3wd to delete third word and preserve whitespace, wWWd or w2Wd to delete three words but preserve whitespace, WWWd or 3Wd to delete three words and any whitespace between cursor and start of first word.

That is, counts work, it’s the movements that are slightly different. See manual §3.4–6[1].

[1]: https://github.com/mawww/kakoune#34-movement