Vimjas / vim-python-pep8-indent

A nicer Python indentation style for vim.
Creative Commons Zero v1.0 Universal
790 stars 69 forks source link

New line after ":" place 8 spaces for indent. #9

Closed vincentwyshan closed 10 years ago

vincentwyshan commented 11 years ago

Generally, we use 4 spaces for indent, just like this

def test():
    print 'hello world'

but with vim-python-pep8-indent, I got 8 spaces for indent.

def test():
        print 'hello world'

Only after I add setlocal shiftwidth=4 into indent/python.vim, then it works as I expected.

I install vim-python-pep8-indent as the installation , I suppose I didn't miss anything and I wondering is it a bug?

hynek commented 11 years ago

Hm since you’re the first to report this I can only assume it’s some interaction with another plugin. What if you disable all others? Does it still happen?

vincentwyshan commented 11 years ago

this is my vimrc:

filetype plugin on
filetype plugin indent on 

this is .vim, in which only pep8-indent

>>> tree .vim
.vim
└── indent
    └── python.vim

And I still have this issue.

FYI, my environment is osx.

hynek commented 11 years ago

Ah you’re right. I presume everyone has a global shiftwidth of 4 defined. I guess we should check whether the user set something local and if not, use 4 as per PEP8.