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
I will also second Josh's json-mode, but also recommend flymake-json as an addition. It helps highlight syntax errors.
I don't like using python -mjson.tool
because it reorders items in JSON objects.
I find (prog-indent-sexp)
works just fine to reindent, and using jsonlint
instead of python -mjson.tool
works for pretty printing/reformatting in beautify-json
(eval-after-load "json-mode"
'(progn
(require 'flymake-json)
;; flymake-cursor displays error in minibuffer message area instead of requiring hover
(require 'flymake-cursor)
(add-hook 'json-mode-hook 'flymake-json-load)
(define-key json-mode-map "\C-c\C-n" (function flymake-goto-next-error))
)
)