Created
November 24, 2012 16:12
-
-
Save dotemacs/4140327 to your computer and use it in GitHub Desktop.
add-to-mode function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun add-to-mode (mode &rest files) | |
"Turn on MODE's syntax highlighting for FILES | |
where FILES is either a file or a regular expression" | |
(dolist (file files) | |
(add-to-list 'auto-mode-alist (cons file mode)))) | |
(add-to-mode 'ruby-mode | |
"\\.gem\\(rc\\|spec\\)$" | |
"\\.\\(irbrc\\|rake\\|ru\\)$" | |
"\\(Cap\\|Gem\\|Rake\\|Puppet\\|Vagrant\\)file$") | |
(add-to-mode 'markdown-mode "\\.\\(md\\|markdown\\)$") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment