]> gitweb.michael.orlitzky.com - emacs.d.git/blob - mode-hooks/css-mode-hooks.el
Initial commit.
[emacs.d.git] / mode-hooks / css-mode-hooks.el
1 (defun cssm-right-brace-macro()
2 (interactive)
3 (cssm-insert-right-brace-and-indent)
4 (forward-char)
5 )
6
7
8 (defun cssm-hook()
9
10 (cssm-leave-mirror-mode)
11 (setq cssm-indent-function 'cssm-c-style-indenter)
12
13 (define-key cssm-mode-map (read-kbd-macro "}") 'cssm-right-brace-macro)
14
15 ;; Add "focus" to the list of pseudo-selectors
16 (add-to-list 'cssm-pseudos "focus")
17
18 ;; Redefine the CSS regular expressions to allow underscores
19 (setq cssm-font-lock-keywords
20 (list
21 (cons (cssm-list-2-regexp cssm-keywords) font-lock-keyword-face)
22 (cons "\\.[a-zA-Z][-a-zA-Z_0-9.]+" font-lock-variable-name-face)
23 (cons (concat ":" (cssm-list-2-regexp cssm-pseudos))
24 font-lock-variable-name-face)
25 (cons "#[a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)?"
26 font-lock-reference-face)
27 (cons "\\[.*\\]" font-lock-variable-name-face)
28 (cons "#[-a-zA-Z_0-9]*" font-lock-function-name-face)
29 (cons "rgb(\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*,\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*,\\s-*[0-9]+\\(\\.[0-9]+\\s-*%\\s-*\\)?\\s-*)"
30 font-lock-reference-face)
31 )
32 )
33 )
34
35
36 (add-hook 'css-mode-hook (function cssm-hook))