I’m working on a grammar for a language that requires some tabs/spaces setting that I’ve never seen anywhere else. I’m not sure how to set up Atom to follow the language specifications.
This language requires indentation levels of 4 spaces, but as soon as 8 spaces are found (two levels of indentation), a hard tab should be used instead.
Here’s an example:
// First indentation level ....// Second indentation level: 4 spaces -> // Third indentation level: 1 tab with width equal to 8 spaces -> ....// Fourth: 1 hard tab (==8 spaces) + 4 spaces -> -> // Fifth: 2 hard tabs
I am able to achieve this under KDE’s Kate using this specific modeline:
kate: replace-tabs off; indent-width 4; tab-width 8;
What would be the best way for Atom? Is it possible at all?
I’ve tried the following in my config.cson:
".source.newlanguage": editor: tabLength: 8 softTabs: false
- The softTab option is ignored completely, spaces are always inserted;
- The tabLength affects the indentation created by pressing the tab key, it does not tell Atom to “stretch” tab characters to 8 spaces. This means I cannot reach the above example’s second indentation level as 8 spaces are automatically inserted;
- Could these settings go into the language package I’m creating (instead of in the user’s config.cson located in ~/.atom/config.cson)?