Fork me on GitHub
#cider
<
2022-10-04
>
pesterhazy07:10:48

Heya! Is there a way to make cider-connect use localhost and the port in .nrepl-port without me asking any questions? I'd like it to be as fast as possible

pesterhazy07:10:07

I use this:

(defun cider-force-connect ()
  (interactive)
  (let ((repl (cider-current-repl nil nil)))
    (when repl
      (cider-quit repl))
    (cider-connect '(:host "localhost" :port 48888))))

pesterhazy07:10:43

This works great... but it requires me to hardcode the nrepl port, which gets annoying with multiple projects

pesterhazy08:10:35

Speaking of which, I find this super useful. I call it cider-force-eval-buffer, and it connects and evals, all in a single shortcut (no questions asked) https://github.com/pesterhazy/emacs.d/blob/master/elisp/my-functions.el#L20

pesterhazy08:10:09

Because always the first thing I do is to eval the current buffer, so I might as well connect then as well

pesterhazy08:10:28

Just tried your snippet, works great @U0509NKGK!