Vim getting indentation wrong for Python code (with the python-mode Plugin)

Viewed 5922

As shown in the following screen-cast, I demonstrate the strange behaviors of Vim when it comes to adding comments to Python code. Between Demo 1 and Demo 2, I was only starting the line of comments at different indentation level (inside a class definition).

Demo 1

enter image description here

Demo 2

enter image description here

The problem:

As demonstrated towards the end of screen-cast, only typing : in insert mode will get the indentation right.

An ideal solution would achieve:

That when starting a line of comment, please leave the indentation level correctly;

2 Answers
Related