   (setq web-mode-enable-auto-closing t)
   (setq web-mode-enable-auto-quoting t))
 
+(use-package window-numbering
+  :ensure t
+  :init
+  (window-numbering-mode))
+
 (use-package yasnippet
   :ensure t
   :defer t
-  :config
+  :diminish (yas-minor-mode)
+  :init
   (yas-global-mode 1))
+
+(use-package tern
+  :diminish (tern-mode)
+  :config
+  (defun my-js-mode-hook ()
+    "Hook for `js-mode'."
+    (set (make-local-variable 'company-backends)
+         '((company-tern company-files))))
+  (add-hook 'js2-mode-hook 'my-js-mode-hook)
+  (add-hook 'js2-mode-hook 'company-mode)
+  (add-hook 'js2-mode-hook 'tern-mode))
+
+;; company backend for tern
+;; http://ternjs.net/doc/manual.html#emacs
+(use-package company-tern
+  :ensure t
+  :diminish (company-mode))

  :init
  (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
  :config
  (setq js2-basic-offset 2)
  (setq js2-strict-missing-semi-warning nil)
  (setq js-switch-indent-offset 2))

(use-package magit
  :ensure t

(require 'bind-key)


(use-package ag
  :ensure t)

(use-package anzu
  :ensure t
  :diminish anzu-mode
