how to unindent in vim without leaving edit mode?

Vim

Vim Problem Overview


I'm writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block. Normally I can just type << to unindent, but it takes too many keystorkes, anyone have a better idea?

Vim Solutions


Solution 1 - Vim

Type Ctrl-D on your keyboard, removes one tabstop at a time, works for space-replaced tabs.

Solution 2 - Vim

In Vim in Linux you can unindent multiple lines by using V to select your first line. Press the down arrow to select multiple lines. Then type < to unindent all of the lines.

If you want to indent, type > instead

Solution 3 - Vim

Backspace will remove one level of indent at a time.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFurtiveFelonView Question on Stackoverflow
Solution 1 - VimEvgenyView Answer on Stackoverflow
Solution 2 - VimViragosView Answer on Stackoverflow
Solution 3 - VimjheddingsView Answer on Stackoverflow