Emacs mode to edit JSON

后端 未结 12 1763
面向向阳花
面向向阳花 2021-01-30 12:15

Does anybody know a good Emacs mode to edit JSON? An app I am working on uses a JSON based communication protocol and having the data nicely indented and syntax-highlighted woul

12条回答
  •  长情又很酷
    2021-01-30 13:10

    I would also recommand js2-mode.

    JSON stands for JavaScript Object Notation. It's not another language and it's even not a data container like yaml or xml are. JSON could be used as a data container if there's no function (or in this case we should say method) inside a JSON object, but it's not the primary goal of JSON :-)

    var myJSObject = {
      attr: {foo: "bar", baz: ["quux", "truc", "pouet"]},
      fooAlert: function (num) {
        alert(this.attr.foo+' '+num);
      }
    };
    myJSObject.fooAlert(42);
    

提交回复
热议问题