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).
As demonstrated towards the end of screen-cast, only typing :
in insert mode will get the indentation right.
That when starting a line of comment, please leave the indentation level correctly;
This sounds like a vim setting issue. Starting with vanilla vim, there is no indenting on each line, when I create a new line. If I create a file called .vimrc
in my home
directory. i.e. ~/.vimrc
and put
filetype indent plugin on
in the file, I get what seems like expected indenting behavior. Does that work for you.