In Practical Vim, page 130, the author states:
The aw text object ... include(s) any whitespace characters after or
before the word.
:help aw
states:
Leading or trailing white space is included, but not counted.
However, it seems to me that if both white spaces are present, only the trailing white space is included. If a trailing white space is not present, only then is the leading which space is included.
Consider the following line from vimtutor
:
The approximate time required to complete the tutor is 30 minutes,
depending upon how much time is spent with experimentation.
With cursor on e
of experimentation
daw
gives with.
Fine, so in this case, there is no trailing space so the leading space gets deleted.
Now, subsequent to the above delete, with cursor on s
of spent
, daw
renders is with.
So, in this case, with both trailing and leading white spaces are NOT included for if they were, one would have obtained iswith.
Only one of the white spaces is included in daw
. vaw
on spent
showed visually that the trailing white space is included.
So, my question is, should not the definition of aw
motion be something along the lines of
- no leading or trailing whitespaces if none are present
- only trailing whitespace if both are present
- leading whitespace only if trailing whitespace is not present
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…