Skip to content

Commit 5dd1c57

Browse files
committed
Improve a bit the "Up and Running" section of the manual
1 parent 84b67f4 commit 5dd1c57

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

doc/up_and_running.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ connect. Many Clojurians favour the use of tools like Leiningen, Boot or Gradle
33
to start an nREPL server, but the use of one of them is not a prerequisite to
44
use CIDER.
55

6-
## Setting up a Leiningen or Boot project (optional)
7-
8-
[Leiningen](https://leiningen.org) is the de-facto standard build/project
9-
management tool for Clojure. [Boot](http://boot-clj.com) is a newer build tool
10-
offering abstractions and libraries to construct more complex build
11-
scenarios. Both have a similar scope to the Maven build tool favoured by Java
12-
developers (and they actually reuse many things from the Maven ecosystem).
6+
## Setting up a Clojure project (optional)
137

148
CIDER features a command called `cider-jack-in` that will start an nREPL server
15-
for a particular Leiningen or Boot project and connect to it automatically.
16-
This functionality depends on Leiningen 2.5.2+ or Boot
17-
2.7.0+. Older versions are not supported. For Leiningen, follow the installation
18-
instructions on its web site to get it up and running and afterwards create a
19-
project like this:
9+
for a particular Clojure project and connect to it automatically. Most
10+
popular Clojure project management tools are supported by default - namely
11+
Leiningen, Boot, `clj` (`tools.deps`) and Gradle.
12+
13+
!!! Note
14+
15+
This functionality depends on Leiningen 2.5.2+ or Boot
16+
2.7.0+. Older versions are not supported.
17+
18+
Let's create a simple Clojure project using Leiningen now. Provided you've installed
19+
it already, all you need to do is:
2020

2121
```
2222
$ lein new demo
@@ -30,15 +30,17 @@ Simply open in Emacs a file belonging to your project (like `foo.clj`) and type
3030
<kbd>M-x</kbd> `cider-jack-in` <kbd>RET</kbd>. This will start an nREPL server
3131
and CIDER will automatically connect to it.
3232

33-
If it is a `lein`, `boot` or `tools.deps (deps.edn)` project nREPL will be
34-
started with all dependencies loaded.
33+
!!! Note
34+
35+
If it is a `lein`, `boot` or `tools.deps (deps.edn)` project nREPL will be
36+
started with all dependencies loaded. Dependency auto-injection is currently
37+
not support for Gradle projects.
3538

3639
Alternatively you can use <kbd>C-u M-x</kbd> `cider-jack-in` <kbd>RET</kbd> to
3740
specify the name of a `lein`, `boot` or `tools.deps` project, without having to
3841
visit any file in it. This option is also useful if your project contains some
3942
combination of `project.clj`, `build.boot` and `deps.edn` and you want to launch
40-
a repl for one or the other.
41-
43+
a REPL for one or the other.
4244

4345
!!! Tip
4446

@@ -47,8 +49,27 @@ a repl for one or the other.
4749
For further customizing the command line used for `cider-jack-in`, you can
4850
change the following (all string options):
4951

50-
* `cider-lein-global-options`, `cider-boot-global-options`, `cider-gradle-global-options`: these are passed to the command directly, in first position (e.g. `-o` to `lein` enables offline mode).
51-
* `cider-lein-parameters`, `cider-boot-parameters`, `cider-gradle-parameters`: these are usually tasks names and their parameters (e.g.: `dev` for launching boot's dev task instead of the standard `repl -s wait`).
52+
* `cider-lein-global-options`, `cider-boot-global-options`,
53+
`cider-clojure-cli-global-options`, `cider-gradle-global-options`:
54+
these are passed to the command directly, in first position
55+
(e.g. `-o` to `lein` enables offline mode).
56+
* `cider-lein-parameters`, `cider-boot-parameters`,
57+
`cider-clojure-cli-parameters`, `cider-gradle-parameters`: these
58+
are usually tasks names and their parameters (e.g.: `dev` for
59+
launching boot's dev task instead of the standard `repl -s wait`).
60+
61+
Note that if you try to run `cider-jack-in` outside a project
62+
directory normally you'd get a warning to confirm you really want to
63+
do this, as more often than not you'd probably do this
64+
accidentally. If you decide to proceed, CIDER will invoke the command
65+
configured in `cider-default-repl-command`. This used to be `lein
66+
repl` prior to CIDER 0.17 and it was switched to Clojure's CLI (`clj`)
67+
afterwards.
68+
69+
!!! Tip
70+
71+
You can set `cider-allow-jack-in-without-project` to `t` if you'd like to
72+
disable the warning displayed when jacking-in outside a project.
5273

5374
## Connect to a running nREPL server
5475

0 commit comments

Comments
 (0)