 ;; js-mode
 (add-hook 'js-mode-hook
           (lambda()
-            (hs-minor-mode t)
-            (when (and
-                   (require 'tern-mode nil t)
-                   (require 'tern-auto-complete nil t))
-              (tern-mode t)
-              (tern-ac-setup))))
+            (when (require 'tern-mode nil t)
+              (eval-after-load "company"
+                '(add-to-list 'company-backends 'company-tern))
+              (tern-mode t))))
 
 ;; FlyCheck
 (when (or (require 'flycheck-mypy nil t)

  (define-key ctl-x-map [(control ?-)] 'zoom-in/out)
  (define-key ctl-x-map [(control ?=)] 'zoom-in/out)
  (define-key ctl-x-map [(control ?0)] 'zoom-in/out))

;; Turn on iMenu for code outlines
(dolist (hook (list

  (add-to-list 'auto-mode-alist '("\\.markdown$" . markdown-mode)))

;; Python-mode
(add-hook 'python-mode-hook
          (lambda ()
            (when (require 'py-isort nil t)
              (define-key python-mode-map (kbd "C-c s") 'py-isort-buffer))
            (hs-minor-mode t)))

(require 'pyenv-mode-auto nil t)

(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 ()
            (dolist (process (process-list))
