- Notifications
You must be signed in to change notification settings - Fork21
sanel/monroe
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Monroe isnREPL client forEmacs, focused on simplicity and easy distribution primarily targetingClojure users.
If you are not familiar with nREPL, it is protocol for accessingClojureREPL overthe network.
In short, Monroe aims to have:
- easy access to Clojure REPL via nREPL protocol
- simple installation without any dependencies, except Emacs
- REPL with colors and history support
- generic approach - you can use it with other languages than Clojure
- only REPL for interaction with shortcuts - no funny windows or buffers with errors,messages and other distractions
On other hand, Monroe is not:
- Clojure IDE likeCider
- Kitchen sink that will do Clojure work for you
Make sure you haveclojure-mode.el
installed first. You can get itfrom Marmalade repository or directly fromhere.
Official Monroe releases you can find onreleases page or you canget it from Marmalade repository of Emacs packages (you are familiarwith Emacs packages, right?).
Latest (and maybe unstable) code you can always get from thisrepository or MELPA repository of Emacs packages.
If you get Monroe by downloading official release or by cloning thisrepository, you can install it by movingmonroe.el
file in$HOME/.emacs.d
folder or any other location listed in Emacsload-path
variable. Installing via Emacs package manager will dothis automatically.
In yourEmacs init file,put:
(require'monroe)(add-hook'clojure-mode-hook'clojure-enable-monroe)
Then, in Emacs:
M-x monroe [RET]
and follow the question about nREPL server location and port.
You can start the nREPL server straight from Emacs by running:
M-x monroe-nrepl-server-start [RET]
and then connect as above.By default Monroe will start Leiningen REPL with command:
lein trampoline repl :headless
You can override this by setting the following variables:
monroe-nrepl-server-cmd
- defaults tolein
monroe-nrepl-server-cmd-args
- defaults totrampoline repl :headless
monroe-nrepl-server-project-file
- defaults toproject.clj
- this is usedfor finding your project's root and launching the REPL process in that location
(Note: these are not verified!)
For boot, set the following in yourinit.el
:
(setq monroe-nrepl-server-cmd"boot")(setq monroe-nrepl-server-cmd-args"repl -S")(setq monroe-nrepl-server-project-file"build.boot")
These shortcuts are valid from code buffer where you edit Clojurecode and wheremonroe-interaction-mode is activated.
Keys | Description |
---|---|
C-c C-c | Evaluate expression at point. |
C-c C-r | Evaluate region. |
C-c C-k | Evaluate current buffer contents. |
C-c C-l | Load current file from disk. |
C-c C-d | Describe symbol at point, showing documentation in REPL window. |
C-c C-n | Evaluate namespace. |
C-c C-b | Interrupt running job. |
M-. | Jump to definition of var at point. |
M-, | Jump back to where you were before you didM-. |
Note the difference betweenC-c C-k andC-c C-l;the former loads the contents of the buffer and sends them directlyover the wire; this can differ from the state of the namespace ondisk, and doesn't always convey line number information. It loads eachtop-level form in the file individually, and if one of them fails itwill continue compiling the rest. The second one tells the server toload the whole file from its disk, so if you are connected to a remoteserver and have made changes to your local copy, they will not beloaded. However, a single exception will halt the whole thing.
These shortcuts are valid in REPL buffer; also, most of the standardcomint-mode shortcuts should work without problems.
Keys | Description |
---|---|
C-c C-d | Describe symbol at point, showing documentation in REPL window. |
C-c C-c | Interrupt running job. |
M-. | Jump to definition of var at point. |
Feel free to report any issues you find or you have suggestions for improvements.
About
Clojure nREPL client for Emacs