yaml-mode.el helps you edit YAML .yml files.

Get it on http://github.com/yoshiki/yaml-mode (Looking for a new maintainer, see on github page.)

And also available as DebianPackage:yaml-mode.

It features font locking for data forms and comments, and some electric keys to help with block literals.

Spaces vs. Tabs

yaml-mode.el enforces spaces instead of TABs in yaml-mode, regardless of emacs configuration.

If you wish to have Return key automatically indent cursor on new line, add the following to emacs config:

(add-hook 'yaml-mode-hook
          (lambda ()
            (define-key yaml-mode-map "\C-m" 'newline-and-indent)))

Indentation Tools

Another good accompanying mode for editing YAML files (and some other structured texts like Python) is indent-tools as it provides functionality related to tree indentation, navigation and commenting.

The highlight-indentation Package visualizes the indentation. It also allows to show the current column prominently.

CategoryModes DataModes