Spacemacs clojure mode auto-inserts requires in ns declarations


#1

Has anyone else noticed that spacemacs clojure mode automatically inserts requires in ns declarations as you write? Example:

(ns foo.bar
  (:require
    [foo.baz :as baz]))
(user/...)
     |
  TYPING THIS SLASH RESULTS IN [foo.user :as user] BEING ADDED TO (:require [...])

Does anybody know how to disable this behaviour? Is it Spacemacs related, or is it a Cider option? I cannot find any documentation on it in either project.


#2

It looks like something related to clj-refactor. Could you try disabling clj-refactor-mode and see if it is still happening?


#3

On Slack @benedek pointed out that this feature can be disabled with

(setq cljr-magic-requires nil)

More details are in the clj-refactor docs.


#4

Thanks, I had simply failed to find the proper clj-refactor docs it seems. Setting to ´:prompt´ as the documentation suggests does not seem to work, but setting it to ´nil´ does disable it, so I am happy.