Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 31 lines (24 sloc) 0.953 kB
eb9eeb5 @technomancy Move lisp bindings and add in JS stuff.
technomancy authored
1 ;;; starter-kit-js.el --- Some helpful Javascript helpers
2 ;;
3 ;; Part of the Emacs Starter Kit
4
5 (eval-after-load 'js2-mode
6 '(progn
7
8 ;; Cosmetics
9 (font-lock-add-keywords
10 'js2-mode `(("\\(function *\\)("
11 (0 (progn (compose-region (match-beginning 1) (match-end 1)
12 ,(make-char 'greek-iso8859-7 107))
13 nil)))))
14
15 (font-lock-add-keywords
16 'js2-mode
17 '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):"
18 1 font-lock-warning-face t)))
19
20 (defun js-lambda () (interactive) (insert "function () {\n};")
21 (backward-char 6))
22
23 (define-key js2-mode-map (kbd "C-c l") 'js-lambda)
24 (define-key js2-mode-map "\C-\M-h" 'backward-kill-word)
25
26 (add-hook 'js2-mode-hook 'coding-hook)
27 (setq js2-bounce-indent-flag nil
28 js2-indent-on-enter-key t)))
29
30 (provide 'starter-kit-js)
31 ;;; starter-kit-js.el ends here
Something went wrong with that request. Please try again.