Search code examples
vimvi

Vim shortcut for unindenting till the start of the line


So I'm aware that you can unindent a line with the shortcut Shift+, (or <) and that you can repeatedly apply it by pressing a number before the shortcut -- for example, 5 + < will unindent 5 times.

Is there a way to repeatedly apply unindent until it reaches the start of the line?


Solution

  • One option is ^d0: move to the start of the indented line, then delete to the start of the entire line.

    Sometimes it’s just easier to << then mash . to repeat, though.