tags:

views:

319

answers:

4

Hi all,

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?

+8  A: 

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

Evgeny
It does work on gVim running on Windows. Not sure if it works somewhere else.
Martinho Fernandes
Sorry, I was clumsy. It does work. +1 :)
Stephan202
+1  A: 

Backspace will remove one level of indent at a time.

jheddings
+3  A: 

If you want to increase indentation use ctrl-t.

skeept
He wants to *decrease* indentation.
Martinho Fernandes
A: 

Put these lines in your .vimrc, and you will be using 4 spaces instead of TAB character, with key indenting and key unindenting properly.

set tabstop=4
set shiftwidth=4
set expandtab
set smarttab
set cindent
Ivan Nikolaev