Add jq-pretty-print command
This commit is contained in:
parent
a60c32e87a
commit
4a4975d5fa
@ -1468,6 +1468,14 @@ Some aliases:
|
||||
:commands (json-navigator-navigator
|
||||
json-navigator-navigate-after-point
|
||||
json-navigator-navigate-region))
|
||||
|
||||
(defun jq-pretty-print ()
|
||||
(interactive)
|
||||
(let ((begin (if (region-active-p) (region-beginning) (point-min)))
|
||||
(end (if (region-active-p) (region-end) (point-max))))
|
||||
(shell-command-on-region begin end "jq ." nil t)))
|
||||
|
||||
(general-def json-mode-map "C-M-\\" 'jq-pretty-print)
|
||||
#+END_SRC
|
||||
|
||||
* JavaScript
|
||||
|
Loading…
Reference in New Issue
Block a user