Closed for-coursera closed 8 years ago
@for-coursera It's not just you. Changed it so that if you're more than 2 lines away from a non-blank line, it'll go with your indentation. I also made the auto indent slightly more intelligent:
if True:
if True:
pass
else:
pass # press enter here
elif: # typing this and pressing : the autoindent
# will trigger and move this back to column 1
If you still don't want to use the autoindent in this plugin, don't add the +indent
to the BracelessEnable
command. You will have to reload the buffer (:e!
after :w
) for it to take effect.
Thanks! That looks interesting...
Also, I somewhat was under impression that without +indent
the objects themselves won't work, too. Good to know it's not true.
I guess I should clarify the above example. The autoindent is contextual now. It'll know that the immediate if
statement is already terminated with an else
statement, and will indent the elif
with the one above it. It does this for else
, elif
, except
, and finally
since those can be nested and are aggravating to properly indent when I want to keep typing.
Don't know, if it's just me, but right now if you press an Enter on a zero-indented line, you got an indent on the next one. As I understand from the description, that seems to be a feat. Then, is it possible to turn it off?