mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
I removed the grammar recipes in3b58741to avoid redundancy with the upstream recipes, but didn't realize that those upstream recipes weren't added until Emacs 31, so users on 30 and older would get errors when trying to install any missing grammars. This also establishes a hard dependency between :lang (php +tree-sitter) and :lang ({javascript,web} +tree-sitter). Amend:3b58741522
42 lines
1.1 KiB
EmacsLisp
42 lines
1.1 KiB
EmacsLisp
;;; lang/json/config.el -*- lexical-binding: t; -*-
|
|
|
|
(use-package! json-mode
|
|
:mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'"
|
|
:config
|
|
(set-electric! 'json-mode :chars '(?\n ?: ?{ ?}))
|
|
|
|
(when (modulep! +lsp)
|
|
(add-hook 'json-mode-local-vars-hook #'lsp! 'append))
|
|
|
|
(map! :after json-mode
|
|
:map json-mode-map
|
|
:localleader
|
|
: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))
|
|
|
|
|
|
(use-package! json-ts-mode ; 29.1+ only
|
|
:when (modulep! +tree-sitter)
|
|
:defer t
|
|
:init
|
|
(set-tree-sitter! 'json-mode 'json-ts-mode
|
|
'((json :url "https://github.com/tree-sitter/tree-sitter-json"
|
|
:commit "4d770d31f732d50d3ec373865822fbe659e47c75")))
|
|
:config
|
|
(when (modulep! +lsp)
|
|
(add-hook 'json-ts-mode-local-vars-hook #'lsp! 'append)))
|
|
|
|
|
|
(use-package! counsel-jq
|
|
:when (modulep! :completion ivy)
|
|
:defer t
|
|
:init
|
|
(map! :after json-mode
|
|
:map json-mode-map
|
|
:localleader
|
|
"s" #'counsel-jq))
|