yaml-mode.el helps you edit YAML .yml files.
Get it on http://github.com/yoshiki/yaml-mode
The subversion trunk is:
http://svn.clouder.jp/repos/public/yaml-mode/trunk/
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.
Original yaml-mode.el has incorrect regexp for YAML comments which makes it treat almost everything as comment (at least on my Emacs 23.0.60). This yaml-mode.el fixes it.
As of 2009/07/07, this yaml-mode.el also 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)))
I wasn’t able to reach the above mentioned alternate version, but if you want to just fix the commenting issue, change:
(defconst yaml-comment-re "\\(#*.*\\)"
to:
(defconst yaml-comment-re "\\(#.*\\)"