Emacs minor mode for structural editing of JSON, inspired by lispy
.
-
And More!
See the manual for details.
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.
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)
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
.
Supporting comments with jsonc-mode
is a hidden feature and intentionally undocumented. It may not work for some cases.
- lispy:
json-par
is alispy
for JSON. - Paredit Mode: “JSON Par mode” is named after Paredit Mode.
- Puni: Generic structured editing for many modes.
- Symex mode: Structural editing for Lisp.
json-par
is inspired from lispy
.
GPLv3. See COPYING for details. Copyright (C) 2021 taku0.