Im trying to get a basic JS IDE in Emacs but I just can't get everything to work.
The problems I have is:
1. If I press enter I am not getting auto indent.
2. Flyckeck is not showing up as a minor mode
Below is the relevant part om my .init file.
;JS settings start
(setq js-basic-indent 2)
(setq-default js2-basic-indent 2)
(setq-default js2-basic-offset 2)
(setq-default js2-auto-indent-p t)
(setq-default js2-cleanup-whitespace t)
(setq-default js2-enter-indents-newline t)
(setq-default js2-global-externs "jQuery $")
(setq-default js2-indent-on-enter-key t)
(setq-default js2-mode-indent-ignore-first-tab t)
(setq-default js2-global-externs '("module" "require" "buster" "sinon" "assert" "refute" "setTimeout" "clearTimeout" "setInterval" "clearInterval" "location" "__dirname" "console" "JSON"))
;; We'll let fly do the error parsing...
(setq-default js2-show-parse-errors nil)
;; (autoload 'js2-mode "js2-mode" nil t)
(require 'js2-mode)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
;make the word function in to just f
(font-lock-add-keywords
'js2-mode `(("\\(function *\\)("
(0 (progn (compose-region (match-beginning 1) (match-end 1) "ƒ")
nil)))))
;place warning font around TODO and others
(font-lock-add-keywords 'js2-mode
'(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\):"
1 font-lock-warning-face t)))
;color any defined variables with color-identifiers-mode
(add-hook 'js2-mode-hook 'color-identifiers-mode)
;;Flyckeck for jshint
(require 'flycheck)
(add-hook 'js2-mode-hook
(lambda () (flymake-mode 1)))
;tern mode active for js mode
(add-hook 'js2-mode-hook (lambda () (tern-mode t)))
; End js settings //////////////////////////////
Im borrowing heavily from http://howardabrams.com/projects/dot-files/emacs-javascript.html