Counts


Counts have two jobs in commands, based upon where they are located in the command.

When placed in front of the motion counts are multipliers of that motion. For example, to delete a word one can use dw (short for delete word).

Initial Conditions
I·have·always·believed,·and·I·still·believe,
that·whatever·good·or·bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 
Delete textdw
I·have·always·believed,·and·I·still·believe,
whatever·good·or·bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 

Step 1 shows the initial conditions, while Step 2 shows the result of executing dw. As expected, one word was deleted.

To delete multiple words, we can add a count in front of the motion. For example, let's try executing d4w (literally, "delete 4 words"):

Initial Conditions
I·have·always·believed,·and·I·still·believe,
that·whatever·good·or·bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 
Delete textd4w
I·have·always·believed,·and·I·still·believe,
bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 

When the count is placed in front of the entire command, it means "repeat the entire command count times". So, let's try executing 4dw, which means "delete a word, repeating 4 times":

Initial Conditions
I·have·always·believed,·and·I·still·believe,
that·whatever·good·or·bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 
Delete text4dw
I·have·always·believed,·and·I·still·believe,
bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 

Counts can also be located in both places. For example, we can achieve the same result a 3rd way using 2d2w, which means "delete two words, repeating twice":

Initial Conditions
I·have·always·believed,·and·I·still·believe,
that·whatever·good·or·bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 
Delete text2d2w
I·have·always·believed,·and·I·still·believe,
bad·fortune·may·come·our·way
we·can·always·give·it·meaning·and
transform·it·into·something·of·value.
NORMAL40%2:1
 

The end result of these examples were the same, which can be common for simple commands such as these, through in general commands can have very different results based upon which count location is used. The important thing to take away from this section is that counts can appear in multiple locations of the command, and they preform slightly different tasks based on where they are located.