                   'cider-repl-mode-hook
                   'ielm-mode-hook))
 
-(use-package cider
-  :ensure clojure-mode
+(use-package clojure-mode
   :init (add-hook 'clojure-mode-hook #'clj-refactor-mode)
   :bind (("C-; s" . cider-scratch)
          :map cider-mode-map

  (with-eval-after-load 'company
    (use-package company-auctex
      :config (company-auctex-init))))

;;;;;;;;;;;;;;;;
;; navigation ;;
;;;;;;;;;;;;;;;;

(use-package ido :demand
  :init
  (setq ad-redefinition-action 'accept)
  :config
  (setq ad-redefinition-action 'warn)
  (ido-mode 1)
  (ido-everywhere 1)
  (setq ido-enable-flex-matching t
        ido-max-work-directory-list 0
        ido-enable-last-directory-history nil)
  (use-package ido-complete-space-or-hyphen)
  (use-package ido-ubiquitous
    :config (ido-ubiquitous-mode 1))
  (use-package ido-vertical-mode
    :config
    (ido-vertical-mode 1)
    (setq ido-vertical-show-count t)
    (setq ido-vertical-define-keys 'C-n-C-p-up-down-left-right))
  (use-package flx-ido
    :config
    (flx-ido-mode 1)
    (setq ido-use-faces nil
          gc-cons-threshold 20000000)))

(use-package smex
  :bind (("M-x" . smex)
         ("M-X" . smex-major-mode-commands)))

(use-package which-key :demand :diminish ""
  :config (which-key-mode 1))

(use-package avy
  :bind (("C-c j" . avy-goto-word-1) ;; same as ace-jump
         ("C-c l" . avy-goto-char)   ;; letter
         ("C-c k" . avy-goto-char-2) ;; keys
         ("M-g g" . avy-goto-line))
  :config (avy-setup-default))

(use-package windmove
  :bind (("<C-M-left>" . windmove-left)
         ("<C-M-right>" . windmove-right)
         ("<C-M-up>" . windmove-up)
         ("<C-M-down>" . windmove-down)))

(use-package projectile :demand
  :bind ("C-; p" . projectile-global-mode)
  :config (projectile-global-mode 1))

;;;;;;;;;;;;;
;; editing ;;


(use-package company :demand :diminish " K"
  :bind ("C-; k" . global-company-mode)
  :config (global-company-mode 1)
  (unbind-key "<tab>" company-active-map)
  (unbind-key "TAB" company-active-map)
  (use-package company-flx)
  (company-flx-mode 1)
  (use-package company-math)
  (push 'company-math-symbols-unicode company-backends)
  (use-package company-quickhelp)
  (company-quickhelp-mode 1)
  (setq company-idle-delay 0.2
        company-minimum-prefix-length 2
        company-selection-wrap-around t
        company-tooltip-align-annotations t
        company-quickhelp-delay 1))

(use-package flycheck
  :bind ("C-; f" . flycheck-mode)
  :init (hook-all #'flycheck-mode
                  'geiser-mode-hook
                  'ess-mode-hook
                  'shell-mode-hook
