summary refs log tree commit diff
path: root/emacs/custom/my-conf.el
blob: 7b1dd134f837644452323aec2b2948fd74aeea34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;;; my-conf.el --- Configure modes related to configuration files -*- lexical-binding: t -*-

;;; Commentary:
;; Provides configuration for modes that are related to configuration
;; files.

;;; Code:

(add-to-list 'auto-mode-alist '("\\.yml\\'"            . yaml-mode))
(add-to-list 'auto-mode-alist '("_SWARP10_METADATA\\'" . yaml-mode))  ;; roblox related
(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))

(customize-set-variable 'dockerfile-use-sudo t)
(customize-set-variable 'dockerfile-use-buildkit t)

(customize-set-variable 'json-reformat:indent-width 2)
(customize-set-variable 'js-indent-level 2)
(customize-set-variable 'css-indent-offset 2)

(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