I'm using Vim and editing Python scripts.
Autoindent works pretty well in general, but when I start a new line and type '#' to type a comment, Vim unindents that line for me.
For example, if have
def foo():
and I press enter, Vim will indent properly
def foo():
pass
but, if instead of typing pass
, I type #
, it unindents automatically
def foo():
# comment
class Thing():
def __init__(self):
pass
# comment line gets unindented all the way
my .vimrc file follows. anyone know why this is happening?
set tabstop=4
set smartindent
set shiftwidth=4
set expandtab
set backspace=indent,eol,start
set scrolloff=3
set statusline=%f%m%r%h%w\ [%Y\ %{&ff}]\ [%l/%L\ (%p%%)]
set laststatus=2