tanenbring
tanenbring

Reputation: 780

Special indentation style for Emacs and javascript

Running js2-mode for emacs, I need a way to alter the indentation style to look like this:

var test = ["Test",
    "Asdfasdf"
];

Rather than the default:

var test = ["Test",
            "Asdfasdf"
           ];

I've tried to modify stuff like c-offsets-alist but it doesn't take. Any suggestions?

I looked at this question, but it's 5 years old and requires overriding code. Is there a more elegant way to have the below conform to this?

AngularApp.run(["Stuff", "Websocket", "$http", "Other", "More", "Etc", "AndSoOn",
                function(s, w, $http, o, m, e, a) {
                    //code
               }
              ]);

And have it look like this:

AngularApp.run(["Stuff", "Websocket", "$http", "Other", "More", "Etc", "AndSoOn",
    function(s, w, $http, o, m, e, a) {
        //code
    }
]);

Upvotes: 1

Views: 29

Answers (0)

Related Questions