Adobe brackets: write spaces instead of tabs
Asked Answered
H

3

46

I am using brackets with coffeescript, but when I hit Tab, it insert a tabulation whereas i only need 2 spaces. Also, when I create a line break, the indent is tabs, and not spaces. Can I change these 2 setting ?

Homework answered 20/3, 2014 at 17:38 Comment(0)
H
95

In the lower-right of the status bar you should see an indicator saying "Tab Size." Click the label to toggle to spaces. To change the amount of indent, click the number next to it and type a new value.

Note: if the indicator already says "Spaces" then Brackets should be using spaces instead of tab characters already. But it might not feel that way because when you move the cursor or press Backspace, there's a "soft tabs" behavior: the cursor will smartly skips over contiguous spaces to line up evenly with the next tab stop. If that bothers you, there will be a preference in the next release of Brackets (Sprint 38) to disable that behavior, making the cursor never move more than one space at a time.

Hardcore answered 21/3, 2014 at 5:35 Comment(0)
U
20

For language specific control, Brackets allows you to provide different tab and space indentation values in the brackets.json file. For example:

"language": {
    "html": {
        "spaceUnits": 4
    },
    "javascript": {
        "tabSize": 2
    }
}
Ungovernable answered 22/4, 2015 at 20:52 Comment(1)
Wow, this is extremely useful. And you can leave a default "spaceUnits" outside of "language": {...}. Also, I'll put this link here for anyone looking to edit brackets.json: github.com/adobe/brackets/wiki/How-to-Use-Brackets#preferencesDammar
A
0

For changing tab spacing you can edit your brackets.json file. you can find it on Debug->Open Preferences File and simple add "spaceUnits": 2 at the end of the file for 2 space. Remember to add a comma on previous line. You can edit that file for customizing your bracket.
Or you can change it more easily at the right-bottom of your bracket interface you saw a option Space: 4 click on the number and change it as your wish...

Anole answered 2/1, 2018 at 8:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.