1

For some reason when I create a new line in vim and the first character I enter is "#" (to add a comment in python for example) vim cancels the automatically created tabs and moves the number sign and the cursor to the start of the line. It happens when I use the "o" command from Normal mode and when I press enter in Insert mode.

For example, if I have a function:

def some_function():
    a = 1

And I create a new line under "a = 1", vim will automatically indent the new line. But if I enter "#" it will jump back to the start of the line.

Does anybody know what causes this? And more importantly, how do I cancel it?

  • 3
    http://stackoverflow.com/questions/354097/how-to-configure-vim-to-not-put-comments-at-the-beginning-of-lines-while-editing – jobo3208 Mar 15 '13 at 18:10
  • @jobo3208 ach.. after posting the answer saw this comment. indeed duplicated.. deleting my answer... – Kent Mar 15 '13 at 18:19

0 Answers0