Following vimtutor
tips I found the following in Lesson 2.3:
Many commands that text are made from an operator and a motion.
The format for a follows:
d motion
Where:
d - is the delete operator.
motion - is what the operator will operate on (listed below).
A short list of motions:
w - until the start of the next word, EXCLUDING its first character.
e - to the end of the current word, INCLUDING the last character.
$ - to the end of the line, INCLUDING the last character.
However, I don't see the difference between dw and de. What's the use case when using dw and de?
dw will delete from cursor to beginning of next word, so will not delete the entire current word under the cursor unless the cursor happens to be at the beginning of the word. So bdw will delete the whole word and the space(s) after it (unless the cursor is already at the beginning of the word).
The basic delete command is d , and you can combine it with movement commands: move to next word is w , delete to next word is dw ; move to next paragraph is } , delete to next paragraph is d} and so on. As a special shortcut, dd deletes a line. You can delete three lines with 3dd .
When you have some changes and use :q , it fails and throws an error stating No write since last change . In order to quit from the Vim without saving changes, you should write :q! , it will quit the Vim and ! will work as a negation, which will negate the write operation.
The cw command preprocesses any specified troff files containing English-language text to be typeset in the constant-width (CW) font. The cw command reads standard input if you do not specify a file or if you specify a - (minus sign) as one of the input file names. The cw command writes to standard output.
dw
means "cut from here to next word".
before: fo[o]bar baz
dw
after: fo[b]az
de
means "cut from here to the end of the current word".
before: fo[o]bar baz
de
after: fo[ ]baz
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With