Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added config for js-mode.

  • Loading branch information...
commit 6258569f6bf91b5833ee971eca78dce82ac5ea6a 1 parent c88e64e
@prajwalit authored
Showing with 17 additions and 0 deletions.
  1. +16 −0 config/js-mode.el
  2. +1 −0  init.el
View
16 config/js-mode.el
@@ -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
1  init.el
@@ -51,4 +51,5 @@
(load-config "yas")
(load-config "bindings")
(load-config "js2-mode")
+(load-config "js-mode")
(load-config "magit")
Please sign in to comment.
Something went wrong with that request. Please try again.