Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Default Keybindings

- `C-c C-f`: format the region/buffer with `json-reformat` (<https://github.com/gongo/json-reformat>)
- `C-c C-p`: display a path to the object at point with `json-snatcher` (<https://github.com/Sterlingg/json-snatcher>)
- `C-c P`: copy a path to the object at point to the kill ring with `json-snatcher` (<https://github.com/Sterlingg/json-snatcher>)

Indent Width
----
Expand Down
7 changes: 7 additions & 0 deletions json-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ This function calls `json-mode--update-auto-mode' to change the

(define-key json-mode-map (kbd "C-c C-p") 'json-mode-show-path)

;;;###autoload
(defun json-mode-kill-path ()
(interactive)
(kill-new (jsons-print-path)))

(define-key json-mode-map (kbd "C-c P") 'json-mode-kill-path)

;;;###autoload
(defun json-mode-beautify ()
"Beautify / pretty-print the active region (or the entire buffer if no active region)."
Expand Down