1970
2017
The mode we should spend MOST of the time
When we are in another mode, press <esc> to come back to normal
We should leave this mode as soon as possible
Because the undo command will remove all the previous command. An insertion is only one command.
It's sometimes faster to manually select lines
We shouldn't use it too much though. It's not repeatable.
Just press v to enter visual mode
Update the following text to insert the missing "b" in front of "rown", then insert "The" at the beginning of the
line and finally go back to the end of line to add the missing "."
quick rown fox jumps over the lazy dog
Update the following text to insert the missing "b" in front of "rown", then insert "The" at the beginning of the
line and finally go back to the end of line to add the missing "."
quick rown fox jumps over the lazy dog
Solution:
<right><right><right><right><right>ab<esc>IThe<esc>A.<esc>
k
h
l
j
[a-zA-Z0-9_]+
<space>
Any movement can take a count.
For example, move to the next second word
2w
Jump to the ".", then go the the beginning of "lazy", then go back to the start of the line. Finally jump to "jumps".
The quick brown fox jumps over the lazy dog.
Jump to the ".", then go the the beginning of "lazy", then go back to the start of the line. Finally jump to "jumps".
The quick brown fox jumps over the lazy dog.
Solution:
$2b^/j<enter>
Any command can take a count.
For example, to copy the 2 lines
2yy
Example copy the next word
yw
Example delete until "end"
d/end
Copy "The quick brown", paste it after the final ".". Then delete the word lazy.
The quick brown fox jumps over the lazy dog.
Copy "The quick brown", paste it after the final ".". Then delete the word lazy.
The quick brown fox jumps over the lazy dog.
Solution:
y/ f<enter>$p/l<enter>dw