Alternate to using backspace in vim
When I do a mistake in vim, I use backspace, becaus开发者_JS百科e changing to command mode and use 'x' is longer, but maybe is other way to do it vim-way?
ctrl-w
to erase the last word, ctrl-u
to erase the entire line you're on.
In insert mode ctrl+h
does the same thing as the backspace key (i.e. deletes one character backwards).
You can use u
to undo. However it tends to erase the whole last line you typed...
Depending on the situation you can use the following text objects :
ciw
to erase and rewrite the current wordc$
to erase and rewrite everything to the end of the linec^
to erase and rewrite everything to the beginning of the lineci)
to change the content of parentheses
See :help text-objects
for more.
If you need to change a single letter, the Vim way could be to use r
to replace the wrong letter.
- type
tje home
- Put your cursor on
j
usingfj
orFj
depending if your cursor is after or beforej
- Type
r
and thenh
精彩评论