Emacs和javascript的特殊缩进样式

时间:2017-06-02 01:29:15

标签: javascript emacs indentation js2-mode

为emacs运行js2-mode,我需要一种方法来改变缩进样式,如下所示:

$(".detach").click(function(){
        var driver_id =  $(this).attr("value");
        # You can out more value to get into html and get here

        var res = confirm("This will remove " + app_id + " from List. Are you sure ?");

        if (res){
            if(ajaxAction) ajaxAction.abort();
             ajaxAction = $.getJSON(baseUrl+'/deleteordosomething/', { driver_id: driver_id }, function(data){
                alert(data);
                location.reload();
             });

        }
    });

而不是默认值:

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

我试图修改var test = ["Test", "Asdfasdf" ]; 之类的内容,但它并没有。有什么建议吗?

我查看了这个question,但它已经5岁了,需要重写代码。是否有一种更优雅的方式让下面符合这一点?

c-offsets-alist

看起来像这样:

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

0 个答案:

没有答案
相关问题