This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-10
Channels
- # aws (45)
- # bangalore-clj (16)
- # beginners (109)
- # boot (137)
- # cider (7)
- # cljs-dev (54)
- # cljsrn (22)
- # clojure (77)
- # clojure-conj (1)
- # clojure-greece (2)
- # clojure-nl (5)
- # clojure-russia (36)
- # clojure-spec (15)
- # clojure-uk (54)
- # clojurescript (118)
- # cursive (7)
- # datomic (25)
- # emacs (33)
- # hoplon (276)
- # klipse (38)
- # lein-figwheel (1)
- # leiningen (9)
- # melbourne (1)
- # off-topic (18)
- # om (98)
- # onyx (6)
- # pedestal (1)
- # perun (24)
- # re-frame (46)
- # reagent (6)
- # ring-swagger (3)
- # spacemacs (67)
- # specter (15)
- # untangled (33)
- # vim (6)
is there a way to configure emacs+cider so that if I open a project with, say, a project.clj
, emacs will split into a few frames, automatically find, say, core.clj
, and start cider, showing the repl buffer in a given frame? And could I configure this on a per-project basis?
I assume you probably don’t really want to start a REPL when you open a project.clj. But if you do start cider from the project, you can use :main to set your starting namespace.
If you don’t own the project to update main, I suggest may trying projectile. C-c p f core would work pretty well.
@norman what I'm looking for is a bit of automation; as it stands, it takes a lot of key strokes to get all the right files, buffers, repl, etc. open and split into convenient windows... so a command that could launch all of that would be awesome!
Honestly, I’d put all the repl stuff in dev/user.clj and have shell command that opened the correct namespace in emacs instead of the project.
Launching from shell sounds great. By dev/user.clj
do you mean a project-local one, or a computer-global one? I'm not sure I see either way though, how that could direct emacs in opening files / windows in a configuration.
when you open core.clj and C-c M-j to start cider, you’ll get your core.clj at the top and the repl at the bottom. You’ll be in the user namespace
Since you’d never want a repl to start automatically without being asked, that’s about as optimized as I can see getting there. Then if your user.clj has some sort of initialization function you can have it require the desired namespace and switch you into if you want
Everyone has their own workflow desires, so perhaps that just doesn’t work well for you. No idea. Personally, I open project.clj. Start cider. Projectile to the namespace I want to be in, load and go
that makes sense, and is all good advice. I think maybe what I was looking for was M-x read-my-mind
In any case, you can certainly write an emacs function that will split up things, open files and send nrepl commands however you want. If you need some advice on how to write that, I’m sure there are plenty of people here can also help out there.
(it is emacs after all)
that wouldn't be tough to automate with an in-ns
-related command
but, not quite what i was looking for
Hmm - it sounds exactly like what you are looking for, except you’d need to have the desired namespace open instead of being in project.clj
I think you could also write some elisp to do this
@rui.yang There’s a binding that overrides C-M-d
on the mac. I think it’s hiding the dock. You can turn it off via terminal and restarting, and maybe also in the keyboard settings.