Permalink
Browse files

Added config for js-mode.

  • Loading branch information...
1 parent c88e64e commit 6258569f6bf91b5833ee971eca78dce82ac5ea6a @prajwalit committed Sep 19, 2011
Showing with 17 additions and 0 deletions.
  1. +16 −0 config/js-mode.el
  2. +1 −0 init.el
View
@@ -0,0 +1,16 @@
+(add-lib-path "js-mode")
+
+(defun js-mode-changes ()
+ (paredit-mode t)
+ (setq js-indent-level 2)
+ (define-key js-mode-map "{" 'paredit-open-curly)
+ (define-key js-mode-map "}" 'paredit-close-curly-and-newline)
+ ;; fixes problem with pretty function font-lock
+ (define-key js-mode-map (kbd ",") 'self-insert-command)
+ (font-lock-add-keywords
+ 'js-mode `(("\\(function *\\)("
+ (0 (progn (compose-region (match-beginning 1)
+ (match-end 1) "ƒ")
+ nil))))))
+
+(add-hook 'js-mode-hook 'js-mode-changes)
View
@@ -51,4 +51,5 @@
(load-config "yas")
(load-config "bindings")
(load-config "js2-mode")
+(load-config "js-mode")
(load-config "magit")

0 comments on commit 6258569

Please sign in to comment.