Maybe it was discussed many times (I strongly believe), but I could not formulate my question properly. So lets imagine we have this sequence of words:

foo bar baz

Applying 3e will move us onto:

foo bar ba|z

where pipe character is the position of the cursor, but why? As far as I can read the docs e moves you to the end of the next word starting from the current position,. Shouldn't we end up like:

foo bar baz|


Or is this relevant to the idea that final position after applying of the combination should be still placed within a sequence, while baz| is outside this?

  • the only reason 3w moves you there is because the cursor cannot go past the end of the buffer. w moves to the starts of words, not the ends
    – Mass
    Mar 24, 2018 at 20:10
  • @Mass, oh, I meant e not w fixed the original question
    – M.Mass
    Mar 24, 2018 at 20:51

3 Answers 3


This is assuming that your setup is using the ordinary e. If this doesn't answer your question, check if e is mapped to anything with :nmap e

This comes from a fundamental misunderstanding of where vim's cursor is situated. In insert mode, vim functions like a traditional editor, and the cursor goes between characters. So you can have the cursor situated like this:

foo bar ba|z

with the cursor between the 'a' and the 'z'. However, this is impossible in normal mode. In normal mode, rather than having the cursor between characters, you'll have it on a single character. So instead of between the 'a' and the 'z', you'll have it here:

foo bar baz

or here:

foo bar baz

but never here:

foo bar ba|z

One way to make this difference more apparent is to make the cursor shape a bar in insert mode and a block in normal mode. The block will be positioned over the character the cursor is on. This vim tips describes how to set that up.


Essentially it reflects historical choices made in how vi models the cursor position; as other answers have highlighted, the cursor sits on a character rather than before it.

  1. It's why there are separate i and a commands - to start inserting before or appending after the current character.
  2. It's consistent with how vi treats lines; the cursor sits on a line, and there are separate O and o commands for opening a new line before and after it.

It's worth remembering that vi was created by Bill Joy in 1976 to run on real hardware terminals, when few (if any) terminals had the ability to show a cursor to the right of the right-most display position. (Even today most terminal emulators still lack this ability, even when showing a bar cursor.)

There are nods towards this ability in the termcap am and terminfo auto_right_margin attributes, that indicate that a terminal does not keep the cursor at the end of the line after putting a character in that rightmost position, but nothing indicating that the cursor would change shape or otherwise indicate whether it's "before" or "after" that character.


The result is not to put the cursor between the a and z (as the pipe character seems to illustrate in your example) but to put the cursor on the z. In normal mode the cursor sits on top of a character rather than being between characters. (Think of what the replace command does. Wouldn't really work if the cursor was between characters.) Based on that, the definition of "to the end of word", which is how help describes it, is no longer ambiguous. Since it doesn't say before the end of word or after the end of word there is just one choice: on the last element of the word, i.e. z.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.