forked from cjohansen/.emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mode-mappings.el
79 lines (63 loc) · 2.61 KB
/
mode-mappings.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
;; YAML
(autoload 'yaml-mode "yaml-mode")
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
(add-to-list 'auto-mode-alist '("jsTestDriver\\.conf$" . yaml-mode))
;; HTML
(add-to-list 'auto-mode-alist '("\\.jsp$" . html-mode))
(add-to-list 'auto-mode-alist '("\\.jspf$" . html-mode))
;; Ruby
(autoload 'rhtml-mode "rhtml-mode")
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.watchr$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru$" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.erb$" . rhtml-mode))
(require 'gtags-tweaks)
(let ((hook (lambda ()
(gtags-mode t)
(gtags-create-or-update))))
(add-hook 'ruby-mode-hook hook)
(add-hook 'rhtml-mode-hook hook))
;; SVG
(add-to-list 'auto-mode-alist '("\\.svg$" . image-mode))
;; Puppet
(autoload 'puppet-mode "puppet-mode")
(add-to-list 'auto-mode-alist '("\\.pp$" . puppet-mode))
;; JavaScript
(add-to-list 'auto-mode-alist '("\\.js$" . javascript-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . javascript-mode))
(add-to-list 'magic-mode-alist '("#!/usr/bin/env node" . javascript-mode))
;; Snippets
(add-to-list 'auto-mode-alist '("yasnippet/snippets" . snippet-mode))
;; Oppdrag
(require 'oppdrag-mode)
(add-hook 'find-file-hook
(lambda ()
(let* ((file (buffer-file-name))
(len (length file)))
(if (string-match-p "oppdrag-services" file) (oppdrag-mode)))))
;; Buster.JS
(autoload 'buster-mode "buster-mode")
(setq buster-node-executable "/home/christian/local/bin/node")
(add-find-file-hook-with-pattern "test\\.js$" (lambda () (buster-mode)) "require(\\(\"\\|'\\)buster")
;; Markdown
;;(require 'showoff-mode)
(autoload 'markdown-mode "markdown-mode")
(autoload 'showoff-mode "showoff-mode")
(add-to-list 'auto-mode-alist '("\\.md$" . showoff-mode))
;; Plain HTML
(add-to-list 'auto-mode-alist '("\\.html\\'" . html-mode))
;; org-mode
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
;; Mustache
(autoload 'mustache-mode "mustache-mode")
;; Apache config
(autoload 'apache-mode "apache-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.htaccess\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("httpd\\.conf\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("srm\\.conf\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("access\\.conf\\'" . apache-mode))
(add-to-list 'auto-mode-alist '("sites-\\(available\\|enabled\\)/" . apache-mode))
(provide 'mode-mappings)