doomemacs/modules/tools/ansible/config.el

35 lines
1.1 KiB
EmacsLisp
Raw Normal View History

2018-09-11 22:16:24 +03:00
;;; tools/ansible/config.el -*- lexical-binding: t; -*-
(use-package! ansible
:commands ansible-auto-decrypt-encrypt
2018-09-11 22:16:24 +03:00
:init
(put 'ansible-vault-password-file 'safe-local-variable #'stringp)
2018-09-11 22:16:24 +03:00
:config
(setq ansible-section-face 'font-lock-variable-name-face
ansible-task-label-face 'font-lock-doc-face)
(map! :map ansible-key-map
2018-09-11 22:16:24 +03:00
:localleader
:desc "Decrypt buffer" "d" #'ansible-decrypt-buffer
:desc "Encrypt buffer" "e" #'ansible-encrypt-buffer
:desc "Look up in Ansible docs" "h" #'ansible-doc))
2018-09-11 22:16:24 +03:00
2020-07-23 01:04:04 -04:00
2018-09-11 22:16:24 +03:00
(after! ansible-doc
(set-evil-initial-state! '(ansible-doc-module-mode) 'emacs))
2020-07-23 01:04:04 -04:00
(use-package! jinja2-mode
:mode "\\.j2$"
:config
;; The default behavior is to reindent the whole buffer on save. This is
;; disruptive and imposing. There are indentation commands available; the user
;; can decide when they want their code reindented.
(add-hook! 'jinja2-mode-hook
(remove-hook 'after-save-hook 'jinja2-indent-buffer t)))
2018-09-11 22:16:24 +03:00
2020-07-23 01:04:04 -04:00
2018-09-11 22:16:24 +03:00
(def-project-mode! +ansible-yaml-mode
:modes '(yaml-mode)
:add-hooks '(ansible ansible-auto-decrypt-encrypt ansible-doc-mode)
2018-09-11 22:16:24 +03:00
:files ("roles/"))