When using the autoindent
configuration from VIM, it will automatically indent your cursor to a meaningful position after creating a new line. But when the first character you enter is a hash character (#
) then the indentation will be removed and the #
will be inserted as the first character of the line.
Why does this happen? How to configure VIM to not do that?
Example (_
as the empty cursor position):
def python_function():
_
after clicking the#
on the keyboard this happens:
def python_function():
#_
but what should have happened is this:
def python_function():
#_