Every time I open .clj file, I have to run
M-x cider-jack-in
to enable Clojure auto-completion in code file.
Can I make Emacs automatically run the command when it starts?
Try this:
(require 'cider)
(defun maybe-cider-jack-in ()
(unless (ignore-errors
(nrepl-current-connection-buffer))
(cider-jack-in)))
(add-hook 'clojure-mode-hook 'maybe-cider-jack-in)