Skip to content

Instantly share code, notes, and snippets.

@jonneale
Last active December 17, 2015 20:39
Show Gist options
  • Save jonneale/5669325 to your computer and use it in GitHub Desktop.
Save jonneale/5669325 to your computer and use it in GitHub Desktop.
Emacs config section used to format json files
(defun beautify-json ()
(interactive)
(let ((b (if mark-active (min (point) (mark)) (point-min)))
(e (if mark-active (max (point) (mark)) (point-max))))
(shell-command-on-region b e
"python -mjson.tool" (current-buffer) t)
(esk-indent-buffer)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment