Skip to content

Commit

Permalink
base settings for basic js mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ruph committed Apr 23, 2012
1 parent e296f8e commit 29fde09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lang-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.