Clean up js2 conf + fix nodejs-repl autoload
This commit is contained in:
parent
098dc9ba21
commit
7bec1bce96
1 changed files with 18 additions and 20 deletions
|
@ -4,7 +4,8 @@
|
||||||
:mode "\\.js$"
|
:mode "\\.js$"
|
||||||
:interpreter "node"
|
:interpreter "node"
|
||||||
:init
|
:init
|
||||||
(use-package nodejs-repl :defer t :commands (nodejs-repl)
|
(use-package nodejs-repl
|
||||||
|
:commands (nodejs-repl)
|
||||||
:config (evil-set-initial-state 'nodejs-repl-mode 'emacs))
|
:config (evil-set-initial-state 'nodejs-repl-mode 'emacs))
|
||||||
|
|
||||||
(define-repl! js2-mode nodejs-repl)
|
(define-repl! js2-mode nodejs-repl)
|
||||||
|
@ -25,14 +26,24 @@
|
||||||
;; Launchbar API
|
;; Launchbar API
|
||||||
"LaunchBar" "File" "Action" "HTTP" "include" "Lib"))
|
"LaunchBar" "File" "Action" "HTTP" "include" "Lib"))
|
||||||
|
|
||||||
|
;; [pedantry intensifies]
|
||||||
|
(defadvice js2-mode (after js2-mode-rename-modeline activate)
|
||||||
|
(setq mode-name "JS2"))
|
||||||
|
|
||||||
(map! :map js2-mode-map
|
(map! :map js2-mode-map
|
||||||
(:localleader
|
(:localleader :nv ";" 'narf/append-semicolon))
|
||||||
:nv ";" 'narf/append-semicolon))
|
|
||||||
|
|
||||||
(after! web-beautify
|
(after! web-beautify
|
||||||
(add-hook! js2-mode (setenv "jsbeautify_indent_size" "4"))
|
(add-hook! js2-mode (setenv "jsbeautify_indent_size" (int-to-string js2-basic-offset)))
|
||||||
(map! :map js2-mode-map :m "gQ" 'web-beautify-js))
|
(map! :map js2-mode-map :m "gQ" 'web-beautify-js))
|
||||||
|
|
||||||
|
(use-package tern
|
||||||
|
:commands tern-mode
|
||||||
|
:init (add-hook 'js2-mode-hook 'tern-mode)
|
||||||
|
:config
|
||||||
|
(require 'company-tern)
|
||||||
|
(define-company-backend! js2-mode (tern)))
|
||||||
|
|
||||||
(use-package js2-refactor
|
(use-package js2-refactor
|
||||||
:init (add-hook 'js2-mode-hook 'emr-initialize)
|
:init (add-hook 'js2-mode-hook 'emr-initialize)
|
||||||
:config
|
:config
|
||||||
|
@ -74,11 +85,7 @@
|
||||||
(log-this "log this" 'both)
|
(log-this "log this" 'both)
|
||||||
(debug-this "debug this" 'both)
|
(debug-this "debug this" 'both)
|
||||||
(forward-slurp "forward slurp" nil)
|
(forward-slurp "forward slurp" nil)
|
||||||
(forward-barf "forward barf" nil))))
|
(forward-barf "forward barf" nil)))))
|
||||||
|
|
||||||
;; [pedantry intensifies]
|
|
||||||
(defadvice js2-mode (after js2-mode-rename-modeline activate)
|
|
||||||
(setq mode-name "JS2")))
|
|
||||||
|
|
||||||
(define-minor-mode nodejs-mode
|
(define-minor-mode nodejs-mode
|
||||||
:lighter " node" :keymap (make-sparse-keymap)
|
:lighter " node" :keymap (make-sparse-keymap)
|
||||||
|
@ -92,22 +99,13 @@
|
||||||
:files ("package.json" "app/index.html" "app/main.js")
|
:files ("package.json" "app/index.html" "app/main.js")
|
||||||
:in (web-mode js2-mode markdown-mode json-mode coffee-mode))
|
:in (web-mode js2-mode markdown-mode json-mode coffee-mode))
|
||||||
|
|
||||||
(use-package tern
|
|
||||||
:commands tern-mode
|
|
||||||
:init (add-hook! js2-mode 'tern-mode)
|
|
||||||
:config
|
|
||||||
(require 'company-tern)
|
|
||||||
(define-company-backend! js2-mode (tern)))
|
|
||||||
|
|
||||||
(use-package unityjs-mode
|
(use-package unityjs-mode
|
||||||
:mode "/Assets/.*\\.js$"
|
:mode "/Assets/.*\\.js$"
|
||||||
:config
|
:config (add-hook 'unityjs-mode-hook 'flycheck-mode))
|
||||||
(add-hook! unityjs-mode 'flycheck-mode))
|
|
||||||
|
|
||||||
(use-package coffee-mode
|
(use-package coffee-mode
|
||||||
:mode "\\.coffee$"
|
:mode "\\.coffee$"
|
||||||
:config
|
:config (setq-default coffee-indent-like-python-mode t))
|
||||||
(setq-default coffee-indent-like-python-mode t))
|
|
||||||
|
|
||||||
(provide 'module-js)
|
(provide 'module-js)
|
||||||
;;; module-js.el ends here
|
;;; module-js.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue