Difference between w and W in escape mode of vim

vim

I am looking at the vim help quickref commands for moving cursor. Following lines confuse me because I find both of them working same. Could some one elaborate me difference with an example.

N  w            N words forward
N  W            N blank-separated WORDS forward

Same question is true for e and E as well.

Best Answer

According to this cheat sheet it would seem to come down to punctuation.

w   jump by start of words (punctuation considered words)
W   jump by words (spaces separate words)
e   jump to end of words (punctuation considered words)
E   jump to end of words (no punctuation)

Example

demo using w

          ss of w

demo using W

          ss of W

Notice in the first demo how when w is continuously hit that the cursor lands on the punctuation, while in the 2nd demo the punctuation is skipped. This is the difference between the lowercase commands and their upper case equivalents.

Related Question