 
 ;; js-mode
 (add-to-list 'auto-mode-alist '("\\.js\\'" . js-jsx-mode))
+(add-hook 'js-mode-hook
+          (lambda()
+            (when (require 'tern-mode nil t)
+              (tern-mode t)
+              (eval-after-load "company"
+                '(add-to-list 'company-backends 'company-tern)))))
 
 ;; FlyCheck
 (when (or (require 'flycheck-mypy nil t)


;; Maximize frame on startup and set up default font
(when (window-system)
  (set-frame-font "DejaVu Sans Mono")
  (set-frame-parameter nil 'fullscreen 'fullboth))

(defun comment-dwim-line (&optional arg)
  "Replacement for the comment-dwim command.


(when (require 'anaconda-mode nil t)
  (add-hook 'python-mode-hook 'anaconda-mode)
  (add-hook 'python-mode-hook (lambda () (anaconda-eldoc-mode t)))
  (eval-after-load "company"
    '(add-to-list 'company-backends '(company-anaconda :with company-capf))))

(add-hook 'inferior-python-mode-hook
          (lambda ()
