    ([remap zap-up-to-char] . zop-up-to-char)))
 
 ;; Functions
+(defun call-and-go-to-previous-buffer (func)
+  "Call FUNC then go to the previous buffer."
+  (interactive)
+  (let ((buffer (current-buffer)))
+    (call-interactively func)
+    (pop-to-buffer buffer)))
+
 (defun cider-toggle-show-repl ()
   "Toggle to show repl."
   (interactive)


(use-package projectile
  :ensure t
  :init
  (setq projectile-completion-system 'ivy)
  :config
  (define-key projectile-mode-map (kbd "M-p") 'projectile-command-map)
  (define-key projectile-mode-map (kbd "M-p s") 'counsel-ag)
  (setq projectile-switch-project-action 'my-projectile-switch-project-action)
  (projectile-mode))

(use-package rainbow-delimiters

  (interactive)
  (call-on-buffer 'query-replace-regexp))

(defun cider-namespace-refresh ()
  "Call 'clojure.tools.namespace.repl/refresh'."
  (interactive)
