Sublime Forum

Indenting to Proper Level on New Line

#1

Hi,

This isn’t necessarily a plugin question, but this still seems like the most appropriate forum. I’ve noticed some languages, like Python, include rules for automatically indenting to the proper level when adding a newline. For example:

def foo():<press enter>
    | # <-- cursor automatically indented to |

I’ve skimmed the Python.tmLanguage file, assuming that’s where rules like this are defined, but haven’t had any luck figuring out exactly what’s doing this. I’d like to implement similar smart indentation to HTML, so that when someone types

followed by a newline, the cursor is positioned one level beyond the “<”.

Any help would be appreciated. Thanks!

-andy

0 Likes

#2

In Pythons case, these settings are controlled by Packages/Python/Miscellaneous.tmPreferences

0 Likes