Reputation: 2427
I fairly often find myself in a situation like this:
I'd like to start typing on the line on which my cursor is currently. However, in order to get to the correct indentation level, I'd have to press TAB several times.
Usually I'd press ddO (delete current line and insert a new one above the cursor), which resets my indentation position to the right place:
But that seems like an odd way to go about adding the correct amount of whitespace.
Is there a better way that I'm overlooking?
Upvotes: 1
Views: 196
Reputation: 56049
When in normal mode, you can use cc or its synonym S. If you are already in insert mode, Ctrlf is the default key for this, but that can be changed by altering cinkeys
(see :h cink
for details).
See also this answer on the Vi/Vim stack
Upvotes: 3
Reputation: 4673
Kevin mentioned some shortcuts, but another method is <C-i>
(indent) and <C-d>
(dedent) in insert mode.
Upvotes: 0