Edit YAML files for Ansible containing embedded Jinja2 templating.
This is a polymode, gluing jinja2-mode
into either yaml-mode
or yaml-ts-mode
. If you usually use yaml-ts-mode
to edit YAML files, then that mode will be used as the host mode; otherwise, yaml-mode
will be used. In either case, minor modes ansible-mode
and ansible-doc-mode
are both also activated.
Although yaml-ts-mode
is built in to Emacs, as of version 29 it is missing basic features compared to yaml-mode
(such as indentation). It also requires the separate installation of the tree-sitter-yaml
Tree-sitter parser (either via your operating system’s package manager, via treesit-auto
, or manually).
Also included is a polymode gluing jinja2-mode
into systemd-mode
, for when you’re using templates to create Systemd unit configurations.
Copyright (C) 2015, 2018, 2020, 2024, Peter Oliver.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.