     (cider-switch-to-repl-buffer)
     (pop-to-buffer buffer)))
 
+(defun clojure-jack-in ()
+  "Start the repl on demand."
+  (unless (cider-current-connection)
+    (cider-jack-in '())))
+
 (defun query-replace-from-beginning-of-buffer ()
   "Call 'query-replace' from beginning of buffer."
   (interactive)


(use-package clojure-mode
  :ensure t
  :bind
  (:map clojure-mode-map
   ([f8] . cider-jack-in-clj))
  :config
  (define-clojure-indent
    (against-background 'defun)
    (alet 'defun)

  :ensure t
  :bind
  (:map cider-mode-map
   ([f8] . cider-show-repl-buffer))
  :config
  (setq cider-prompt-for-symbol nil)
  (setq cider-repl-pop-to-buffer-on-connect nil)
  :hook
  ((cider-mode . eldoc-mode)
   (cider-repl-mode . paredit-mode)))
