Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c933a818c9
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (27 sloc) 1.127 kb
;;; starter-kit-js.el --- Some helpful Javascript helpers
;;
;; Part of the Emacs Starter Kit
(eval-after-load 'js2-mode
'(progn
;; Cosmetics
(font-lock-add-keywords
'js2-mode `(("\\(function *\\)("
(0 (progn (compose-region (match-beginning 1) (match-end 1)
"ƒ")
nil)))))
(font-lock-add-keywords
'js2-mode
'(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):"
1 font-lock-warning-face t)))
(defun js-lambda () (interactive) (insert "function () {\n}")
(backward-char 5))
(define-key js2-mode-map (kbd "C-c l") 'js-lambda)
(define-key js2-mode-map "\C-\M-h" 'backward-kill-word)
(define-key js2-mode-map (kbd "TAB") (lambda () (interactive)
(indent-for-tab-command)
(back-to-indentation)))
(add-hook 'js2-mode-hook 'coding-hook)
(setq js2-bounce-indent-flag nil
js2-indent-on-enter-key t)))
(provide 'starter-kit-js)
;;; starter-kit-js.el ends here
Jump to Line
Something went wrong with that request. Please try again.