summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-04-27 12:48:19 -0700
committerFranck Cuny <franck@fcuny.net>2022-04-27 12:48:19 -0700
commite063a031e5e61a216702dc791c31b4258cf4b31e (patch)
tree25ca37c8de4f9e9157fddb0a4052597a890c919b /emacs
parentconf: simplify (diff)
downloademacs.d-e063a031e5e61a216702dc791c31b4258cf4b31e.tar.gz
my-conf: binding to format JSON buffers
Diffstat (limited to 'emacs')
-rw-r--r--emacs/custom/my-conf.el13
1 files changed, 10 insertions, 3 deletions
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