Consider the sentence
The sky is very blue today.
Let's investigate what happens when we use the vim command
daw with the cursor placed at different positions.
- Cursor at any character of "blue"
The sky is very today
If we were to add a bunch of spaces between "blue" and "today",
daw would still give this same result. It seems like
daw deletes the word the cursor is in plus trailing whitespace.
- Cursor at any character of "today"
The sky is very blue.
In this case, it seems
daw deleted the word and leading whitespace.
If we were to add a space between "today" and the period, then
daw would behave like case 1).
Now, the help documentation for
"a word", select [count] words (see word). Leading or trailing white space is included, but not counted.
I would have expected
daw to delete the word and trailing and leading whitespace based on this documentation.
What are, after all, the different cases in which
daw has distinctive behavior?
When I look at the documentation for
word I see the following information
A word consists of a sequence of letters, digits and underscores, or a sequence of other non-blank characters, separated with white space (spaces, tabs, ). This can be changed with the 'iskeyword' option. An empty line is also considered to be a word. A WORD consists of a sequence of non-blank characters, separated with white space. An empty line is also considered to be a WORD.
From the wording here, I am not sure if there is a distinction between
WORD or not. They seem to be the same thing (in which case, why the two entries in the documentation?)