Skip to content

Commit 3f98cd3

Browse files
authored
Merge branch 'master' into master
2 parents baffd85 + bb500fc commit 3f98cd3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Default Keybindings
2020

2121
- `C-c C-f`: format the region/buffer with `json-reformat` (<https://github.com/gongo/json-reformat>)
2222
- `C-c C-p`: display a path to the object at point with `json-snatcher` (<https://github.com/Sterlingg/json-snatcher>)
23+
- `C-c P`: copy a path to the object at point to the kill ring with `json-snatcher` (<https://github.com/Sterlingg/json-snatcher>)
2324
- `C-c C-t`: Toggle between `true` and `false` at point
2425
- `C-c C-k`: Replace the sexp at point with `null`
2526
- `C-c C-i`: Increment the number at point

json-mode.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ This function calls `json-mode--update-auto-mode' to change the
143143

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

146+
;;;###autoload
147+
(defun json-mode-kill-path ()
148+
(interactive)
149+
(kill-new (jsons-print-path)))
150+
151+
(define-key json-mode-map (kbd "C-c P") 'json-mode-kill-path)
152+
146153
;;;###autoload
147154
(defun json-mode-beautify ()
148155
"Beautify / pretty-print the active region (or the entire buffer if no active region)."

0 commit comments

Comments
 (0)