json-par
json-par copied to clipboard
Emacs minor mode for structural editing of JSON
JSON Par mode
Emacs minor mode for structural editing of JSON, inspired by lispy.
Features
-
-
-
-
Converting single-line to/from multiline
-
And More!
See the manual for details.
Installation
Install json-par package from MELPA.
To install without MELPA, download latest release and execute M-x package-install-file for the .tar archive.
Then add the following line to your .emacs:
(add-hook 'json-mode-hook (lambda () (json-par-mode 1)))
Enabling aggressive-indent-mode is also recommended.
Using only one or two functions
If you feel JSON Par mode officious, you can just pick a few functions and bind them to key sequences you like. Example:
(require 'json-mode)
(require 'json-par-mode)
(define-key json-mode-map (kbd "M-/") #'json-par-insert-guessed)
(define-key json-mode-map (kbd "C-c a") #'json-par-beginning-of-member)
(define-key json-mode-map (kbd "C-c e") #'json-par-end-of-member)
(define-key json-mode-map (kbd "C-c c") #'json-par-clone-member-forward)
Hacking
To build the package locally, run make package.
To install the built package, run make install.
To run tests, run make test.
Make sure to run make lint before submitting a pull request.
For other commands, run make help.
About comments
Supporting comments with jsonc-mode is a hidden feature and intentionally undocumented. It may not work for some cases.
Related projects
- lispy:
json-paris alispyfor JSON. - Paredit Mode: “JSON Par mode” is named after Paredit Mode.
- Puni: Generic structured editing for many modes.
- Symex mode: Structural editing for Lisp.
Acknowledgments
json-par is inspired from lispy.
License
GPLv3. See COPYING for details. Copyright (C) 2021 taku0.