See also answers here:
The second link is probably (I'm guessing) the most applicable to your question, especially if you put in in your .vimrc
Even if you don't, you only need to do the mapping once. Of course, mapping w
overrides its typical "next word" behavior. This might be acceptable to you, since W
(capital W) has a similar behavior, of "next WORD" (which is typically what I actually want to do).
- ASIDE: Vim has between two use cases of "non-blank-characters."
From :help word
in Vim (Emphasis mine on '**or**') :
These commands move over words or WORDS.
*word*
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, <EOL>). This can be changed with the 'iskeyword' option. An empty
line is also considered to be a word.
*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.
What this effectively means is that:
a word
is /(w+
|[\W]+/
--- e.g., *foo*
is 3 word
s total (*, foo, *)
But a WORD
is /S+/
--- e.g., *foo*
is 1 WORD
total