Permalink
Browse files

base settings for basic js mode

  • Loading branch information...
1 parent e296f8e commit 29fde09575a2171af9a85ca190d1bdc0f3509fbb @ruph committed Apr 23, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 lang-javascript.el
View
@@ -6,7 +6,7 @@
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode))
-;; Js-mode Tab Hook
+;; Js2-mode
(add-hook 'js2-mode-hook
(lambda ()
(setq indent-tabs-mode t)
@@ -15,4 +15,11 @@
(local-set-key (kbd "RET") 'newline-and-indent)
(setq js2-missing-semi-one-line-override t)))
+;; default js-mode
+(add-hook 'js-mode-hook
+ (lambda ()
+ (setq tab-width 4)
+ (local-set-key (kbd "RET") 'newline-and-indent)
+ (add-hook 'before-save-hook 'delete-trailing-whitespace)))
+
(provide 'lang-javascript)

0 comments on commit 29fde09

Please sign in to comment.