Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (27 sloc) 1.1 KB
;;; starter-kit-js.el --- Some helpful Javascript helpers
;; Part of the Emacs Starter Kit
(eval-after-load 'js2-mode
;; Cosmetics
'js2-mode `(("\\(function *\\)("
(0 (progn (compose-region (match-beginning 1) (match-end 1)
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)
(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