Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Brackets : how to make autocomplete / autoindent works ?

Brackets seems nice, but I'm encountering two problems using it :

First, I usually autocomplete tags this way : div.class - PRESS TAB -becomes<div class="class"></div>

I can't achieve that... I tried downloading a bunch of plugins, nothing works...

Second problem :

#container
    h3
        color: $ltGreen
        text-transform: uppercase
        font-size: em(24)
        margin-bottom: 0.5em
        font-weight: bold

In this example, if I press Enter/Return key wherever in that part of code, the cursor comes back to the beginning of the line... So I have to press tab lot of time each time I press enter/return...

Is it possible to do that in Brackets ? How ?

like image 990
enguerranws Avatar asked Mar 26 '14 19:03

enguerranws


People also ask

How do I turn on autocomplete in Brackets?

Try Shift+Enter when the tag is suggested.

Is Brackets good for coding?

If you are a beginner, Brackets is a good option because it is more customizable and includes a variety of extensions. If you are an experienced developer, Visual Studio Code is a better choice because it has a built-in debugger and supports a wider range of programming languages.

Is Brackets good for JavaScript?

Brackets has good support for JavaScript, CSS, HTML, and Node. js. It also has nice features such as inline editing of CSS related to an HTML ID (Quick Edit). In addition, Brackets features a clean UI and a live preview for web pages you are editing.

What codes use Brackets?

It is written in JavaScript, HTML and CSS. Brackets is cross-platform, available for macOS, Windows, and most Linux distributions. The main purpose of Brackets is its live HTML, CSS and JavaScript editing functionality.


1 Answers

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

like image 119
peterflynn Avatar answered Oct 10 '22 18:10

peterflynn