k1LoW / emacs-ansible

GNU General Public License v2.0
116 stars 31 forks source link

Improves syntax highlight of ansible keywords in playbooks. #12

Closed LucianoCavalheiro closed 7 years ago

LucianoCavalheiro commented 7 years ago

Add font-lock keyword definitions to task names, variable expansions, first level sections, etc. Most faces used are standard, except by two, which are configured via customization variables.

The use case I see it to hook ansible mode to yaml-mode in .emacs, so that playbooks will have better syntax highlight:

(defun ansible-playbook-hook()
  (yas-minor-mode 1)
  (auto-complete-mode 1)
  (autopair-mode 1)
  (linum-mode 1)
  (ansible 1)
  (local-set-key (kbd "C-m")   'newline-and-indent)
  (local-set-key (kbd "C-c d") 'ansible-doc)
)
(add-hook 'yaml-mode  'ansible-playbook-hook)
k1LoW commented 7 years ago

@LucianoCavalheiro Thank you! Nice work!!