vim/python indent problem with parenthesis

Alejandro Lopez-Valencia dradul at yahoo.com
Thu Mar 13 13:18:23 EST 2003


On Thu, 13 Mar 2003 13:00:56 +0000 (UTC), Simo Salminen
<simo_salminen at iki.fi> wrote:

>I've played with VIM lately, and stumbled to problems with its
>python indenting. I really like the emacs-python mode of indenting
>stuff inside parenthesis, like this:
>
>(emacs session)
>if (cond and<enter>
>    <- cursor moves here
>		
>now, the same code in VIM:
>
>if (cond and<enter>
><- cursor moves here
>
>Now I have to manually indent, but then there is another problem:
>
>if (cond and
>    cond):<enter>
>        <- VIM indents two times!
>
>
>Has anyone else stumbled to these problems, and maybe even have
>patched indent/python.vim available (*wishful thinking*) ?

Hmm... That's an editor configuration problem. You may want to report
it to developer (bugs at vim dot org), you may have better luck than I
did sometime ago. BTW, you may want to pose this question in the vim
users mailing list, a more appropriate forum, I'd believe. Check
http://vim.sourceforge.net/.

In the meantime you might want to use the following ftplugin (for the
benefit os those who only search c.l.p.'s archive):

---begin python_pep8.vim
if exists("did_python_pep8")
	finish
else
	let did_python_pep8=1
endif
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set textwidth=80
---end python_pep8.vim

-- 
Alejandro Lopez-Valencia                          tora no shinden
python -c "print('ZHJhZHVsQDAwN211bmRvLmNvbQ=='.decode('base64'))"




More information about the Python-list mailing list