Few days ago I decided to use the Vim text editor… playing around with the vimtutor I found something very rare with the d operator; Vim session:
Case 1
before: The Quick Red Fox Jumps Over the Lazy Brown Dog
after : The Quick Red F Jumps Over the Lazy Brown Dog
results: as expected.
Case 2
Placing the cursor in the last character of a word.
before: The Quick Red Fox Jumps Over the Lazy Brown Dog
after : The Quick Red Fo Over the Lazy Brown Dog
results: de deletes the "x Jumps" substring.
Case 3
Placing the cursor in the last character of the last word.
before: The Quick Red Fox Jumps Over the Lazy Brown Dog
after : The Quick Red Fox Jumps Over the Lazy Brown Do
results: as expected.
Please note that:
- In both cases I’m using the
decommand. - after: reflects the changes after applying the
decommand. - The highlighted part represent the cursor position in the editor.
Questions:
- Is this a bug?
- Am I doing something wrong?
- What is happening?
Vim version: version 7.3.50; Modified by Gentoo-7.3.50
When pressing e, vim takes you to the end of the word. If the cursor is on the
xin fox, you are already there, so e takes to the next end of a word.Thus, de will delete
jumpsas well.