Refactor js2-mode-hooks into one function
This commit is contained in:
parent
327cc90288
commit
a5ccfdca4a
@ -1734,6 +1734,8 @@ window is active in the perspective."
|
||||
(uuid (imalison:uuid)))
|
||||
(insert (format "console.log('%s//////////%s//////////');" identifier-string uuid))
|
||||
(setq imalison:identifier-count (+ imalison:identifier-count 1))))
|
||||
(defun imalison:js2-mode-hook ()
|
||||
;; Sensible defaults
|
||||
(setq js2-bounce-indent-p nil
|
||||
js2-basic-offset 4
|
||||
js2-indent-level 4
|
||||
@ -1741,21 +1743,20 @@ window is active in the perspective."
|
||||
js2-highlight-level 3
|
||||
js2-include-node-externs t
|
||||
js2-mode-show-parse-errors nil
|
||||
js2-mode-show-strict-warnings nil)
|
||||
;; jshint-configuration-path "~/Uber/dispatch"
|
||||
(add-hook 'js-mode-hook 'js2-minor-mode)
|
||||
(add-hook 'js2-mode-hook (lambda () (tern-mode t)))
|
||||
(add-hook 'js2-mode-hook 'skewer-mode)
|
||||
(add-hook 'js2-mode-hook (lambda () (setq js-indent-level 4
|
||||
js2-mode-show-strict-warnings nil
|
||||
indent-tabs-mode nil
|
||||
js2-indent-level 4
|
||||
js2-basic-offset 4
|
||||
js2-indent-switch-body t)))
|
||||
(add-hook 'js2-mode-hook (lambda ()
|
||||
js2-indent-switch-body t)
|
||||
(edconf-find-file-hook) ;; Make sure that editorconfig takes precedence
|
||||
(tern-mode t)
|
||||
(when nil (skewer-mode)) ;; TODO: reenable
|
||||
(setq imenu-create-index-function
|
||||
(lambda ()
|
||||
(imalison:flatten-imenu-index
|
||||
(js2-mode-create-imenu-index))))))
|
||||
(js2-mode-create-imenu-index)))))
|
||||
|
||||
(add-hook 'js2-mode-hook 'imalison:js2-mode-hook)
|
||||
(add-hook 'js2-mode-hook 'js2-imenu-extras-mode)))
|
||||
|
||||
(use-package js2-refactor
|
||||
|
Loading…
Reference in New Issue
Block a user