 ;; (use-package smart-mode-line-powerline-theme
 ;;   :ensure t)
 
+(use-package smartparens
+  :ensure t
+  :diminish (smartparens-mode)
+  :init
+  (require 'smartparens-config)
+  (smartparens-global-mode))
+
+(use-package tern
+  :ensure t
+  :diminish (tern-mode)
+  :defer t
+  :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))
+
+(use-package tern-auto-complete
+  :ensure t
+  :init
+  (tern-ac-setup))
+
 (use-package undo-tree
   :ensure t
   :diminish undo-tree-mode

  :config
  (setq org-log-done t)
  (setq org-todo-keywords
      '((sequence "TODO" "IN-PROGRESS" "CANCELLED" "DONE"))))

(use-package org-bullets
  :ensure t

  ("C-<" . mc/mark-previous-like-this)
  ("C-c C-<" . mc/mark-all-like-this))

(use-package nodejs-repl
  :ensure t
  :init
  (add-hook 'js-mode-hook
            (lambda ()
              (define-key js-mode-map (kbd "C-x C-e") 'nodejs-repl-send-last-sexp)
              (define-key js-mode-map (kbd "C-c C-r") 'nodejs-repl-send-region)
              (define-key js-mode-map (kbd "C-c C-l") 'nodejs-repl-load-file)
              (define-key js-mode-map (kbd "C-c C-z") 'nodejs-repl-switch-to-repl))))

(use-package org
  :ensure t
  :defer t
