Simple emacs mode for .gitignore files.

Through the power of generic-mode, adding the following lines to your .emacs file will add syntax-coloring support for .gitignore, .svnignore, etc. files. And by "syntax-coloring" I mean that lines that start with a # will be marked as comments.

(require 'generic-x)
(add-to-list 'auto-mode-alist '("\\..*ignore$" . hosts-generic-mode))

Actually, any text after an un-escaped # will be marked as a comment, which isn't the way Git and SVN interpret those files. (TODO: it would be pretty simple to add a dot-ignore-generic-mode that handles this correctly.)

Published 13 May 2013
Tagged emacs, elisp and todo.

 

This page was generated at 4:16 PM on 26 Feb 2018.
Copyright © 1999 - 2018 Rodney Waldhoff.