Brackets : how to make autocomplete / autoindent works ?

For the first issue, try the Emmet extension. It lets you use that exact CSS-like shorthand and auto-expand it to HTML code.

For the second issue, what type of file are you in? Brackets uses “smart indent” to position the cursor on new lines based on the syntax of the code. If you’re in an HTML file, it will follow the nesting level of the tags surrounding the cursor to decide how far to indent (since the code above isn’t proper HTML syntax, it won’t use it as a cue for indentation – it will treat it as plain text content, to be ignored). If you’re in a plain text file, it will just follow the indent of nearby lines (so the problem you’re describing won’t happen).

It looks like you might actually be writing “classic”-style Sass code in this case? If so, just ensure you’re using standard .sass file extension and newlines should get the correct indent level automatically.

Here’s what a .sass file should look like before pressing Enter: enter image description here

And after pressing Enter – note the cursor is correctly indented: enter image description here

Leave a Comment