-
Notifications
You must be signed in to change notification settings - Fork 1
/
my-web.el
81 lines (69 loc) · 1.7 KB
/
my-web.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
80
;;; my-web --- Web related hooks and hacks
;;
;; Copyright (C) 2014 Alex Bennée
;;
;; Author: Alex Bennée <[email protected]>
;;
;; This file is not part of GNU Emacs.
;;
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;;; Commentary:
;;
;; I've tried to separate this from the spawling my-devel bit
;;
;;; Code:
(require 'use-package)
;; BROKEN?
(defun my-wordpress-hook ()
"Hook function for editing Wordpress code."
(interactive)
(setq tab-width 4
indent-tabs-mode 't))
(defvar my-php-hooks-alist
(mapc
(lambda (elt)
(cons (purecopy (car elt)) (cdr elt)))
'(
(".*/wp-content.*php$" . my-wordpress-hook )
(".*/wordpress.*php$" . my-wordpress-hook )))
"A list of reg-ex to php-mode hooks.")
;;
;; Web stuff, use web-mode
;;
(defun my-web-mode-hook ()
"Hooks for Web mode."
(visual-line-mode)
(flyspell-mode))
(use-package web-mode
:ensure t
:mode ("\\.php$" . web-mode)
:config
(progn
(add-hook 'web-mode-hook 'my-web-mode-hook)))
;; Handy for wiki editing
(use-package mediawiki
:ensure t
:mode ("\\.mw$" . mediawiki-mode)
:commands mediawiki-mode)
(use-package moinmoin-mode
:commands moinmoin-mode)
;;
;; js2-mode, override javascript-mode
;;
(use-package js2-mode
:ensure t
:mode ("\\.js\\'" . js2-mode)
:config
(defalias 'javascript-mode 'js2-mode "js2-mode is aliased to javascript mode"))
;;
;; restclient, make REST calls from Emacs
;;
(use-package restclient
:if (locate-library "restclient")
:commands restclient-mode)
(provide 'my-web)
;;; my-web.el ends here