 (defun cider-show-repl-buffer ()
   "Show cider repl buffer."
   (interactive)
-  (call-func-and-previous-buffer 'cider-switch-to-repl-buffer))
-
-(defun clojure-jack-in ()
+  (call-and-go-to-previous-buffer 'cider-switch-to-repl-buffer))
+
+(defun maybe-cider-jack-in ()
   "Start the repl if there is no current connection."
   (unless (cider-current-connection)
     (cider-jack-in '())))
 
-(defun call-func-from-beginning-of-buffer (func)
-  "Call FUNC from beginning of buffer."
+(defun call-on-buffer (func)
+  "Call FUNC on buffer."
   (interactive)
   (save-excursion
     (goto-char (point-min))
     (call-interactively func)))
 
-(defun query-replace-from-beginning-of-buffer ()
-  "Call 'query-replace' from beginning of buffer."
+(defun query-replace-buffer ()
+  "Call 'query-replace' on buffer."
   (interactive)
-  (call-func-from-beginning-of-buffer 'query-replace))
-
-(defun query-replace-regexp-from-beginning-of-buffer ()
-  "Call 'query-replace-regexp' from beginning of buffer."
+  (call-on-buffer 'query-replace))
+
+(defun query-replace-regexp-buffer ()
+  "Call 'query-replace-regexp' on buffer."
   (interactive)
-  (call-func-from-beginning-of-buffer 'query-replace-regexp))
+  (call-on-buffer 'query-replace-regexp))
 
 ;; Hooks
 (setq custom-file (expand-file-name "custom.el" user-emacs-directory))

(setq use-package-verbose t)

;; We need this function earlier
(defun call-func-and-previous-buffer (func)
  "Call FUNC then go to the previous buffer."
  (interactive)
  (let ((buffer (current-buffer)))

  (define-key projectile-mode-map (kbd "M-p s") 'counsel-ag)
  (setq projectile-switch-project-action (lambda ()
                                           (projectile-recentf)
                                           (call-and-go-to-previous-buffer 'treemacs-select-window)))
  (projectile-mode 1))

(use-package rainbow-delimiters
