From e063a031e5e61a216702dc791c31b4258cf4b31e Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 27 Apr 2022 12:48:19 -0700 Subject: my-conf: binding to format JSON buffers --- emacs/custom/my-conf.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'emacs/custom') diff --git a/emacs/custom/my-conf.el b/emacs/custom/my-conf.el index d91a409..bc41279 100644 --- a/emacs/custom/my-conf.el +++ b/emacs/custom/my-conf.el @@ -6,10 +6,10 @@ ;;; Code: -(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)) -(add-to-list 'auto-mode-alist '("\\.yaml\\'" . yaml-mode)) +(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)) +(add-to-list 'auto-mode-alist '("\\.yaml\\'" . yaml-mode)) (add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode)) -(add-to-list 'auto-mode-alist '("\\.tf\\'" . terraform-mode)) +(add-to-list 'auto-mode-alist '("\\.tf\\'" . terraform-mode)) (customize-set-variable 'dockerfile-use-sudo t) (customize-set-variable 'dockerfile-use-buildkit t) @@ -23,5 +23,12 @@ (add-hook 'terraform-mode-hook 'terraform-format-on-save-mode) +(defun my/js-mode-hook () + "Hooks for `js-mode'." + ;; format the buffer with `jq' + (local-set-key (kbd "C-c C-f") 'jq-format-json-buffer)) + +(add-hook 'js-mode-hook 'my/js-mode-hook) + (provide 'my-conf) ;;; my-conf.el ends here -- cgit 1.4.1