Last active
December 17, 2015 20:39
-
-
Save jonneale/5669325 to your computer and use it in GitHub Desktop.
Emacs config section used to format json files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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