2020-04-23 17:38:45 -04:00
|
|
|
;;; lang/json/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
(use-package! json-mode
|
|
|
|
:mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'"
|
|
|
|
:init
|
|
|
|
(when (featurep! +lsp)
|
2022-03-24 02:19:52 +01:00
|
|
|
(add-hook 'json-mode-local-vars-hook #'lsp! 'append))
|
2022-07-25 17:34:44 +02:00
|
|
|
(when (featurep! +tree-sitter)
|
|
|
|
(add-hook! '(json-mode-local-vars-hook
|
|
|
|
jsonc-mode-local-vars-hook)
|
|
|
|
:append #'tree-sitter!))
|
2020-04-23 17:38:45 -04:00
|
|
|
:config
|
|
|
|
(set-electric! 'json-mode :chars '(?\n ?: ?{ ?}))
|
|
|
|
|
|
|
|
(map! :after json-mode
|
|
|
|
:map json-mode-map
|
|
|
|
:localleader
|
2020-10-06 19:43:32 +03:00
|
|
|
:desc "Copy path" "p" #'json-mode-show-path
|
|
|
|
"t" #'json-toggle-boolean
|
|
|
|
"d" #'json-mode-kill-path
|
|
|
|
"x" #'json-nullify-sexp
|
|
|
|
"+" #'json-increment-number-at-point
|
|
|
|
"-" #'json-decrement-number-at-point
|
|
|
|
"f" #'json-mode-beautify))
|
2020-05-28 10:10:44 -05:00
|
|
|
|
|
|
|
|
2020-05-28 18:11:11 -05:00
|
|
|
|
2020-06-01 16:13:30 -05:00
|
|
|
(use-package! counsel-jq
|
|
|
|
:when (featurep! :completion ivy)
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(map! :after json-mode
|
2020-06-04 20:02:46 -04:00
|
|
|
:map json-mode-map
|
|
|
|
:localleader
|
|
|
|
"s" #'counsel-jq))
|