Skip to content

Instantly share code, notes, and snippets.

@JamesTryand
Created February 13, 2019 00:34
Show Gist options
  • Save JamesTryand/3aaa9604df0bcaca5b77a0987ee92ad7 to your computer and use it in GitHub Desktop.
Save JamesTryand/3aaa9604df0bcaca5b77a0987ee92ad7 to your computer and use it in GitHub Desktop.
setup nrepl
{:user {:plugin-repositories [["private-plugins" {:url "private repo url"}]]
:dependencies [[pjstadig/humane-test-output "0.8.2"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:plugins [[io.sattvik/lein-ancient "0.6.11"]
[lein-pprint "1.1.2"]
[com.jakemccrary/lein-test-refresh "0.5.5"]
[lein-autoexpect "1.4.2"]
[jonase/eastwood "0.2.1"]
[lein-kibit "0.0.8"]]
:test-refresh {:notify-command ["terminal-notifier" "-title" "Tests" "-message"]}}}
@JamesTryand
Copy link
Author

This allows calva to be connected and used ( ctrl+alt+v * ) ( where * is the chord )
c : connect

  • Running tests through the REPL connection, and mark them in the Problems tab
    • Run namespace tests: ctrl+alt+v t
    • Run all tests: ctrl+alt+v shift+t
    • Rerun previously failing tests: ctrl+alt+v ctrl+t
    • Marks test failures using the Problem tab
    • User setting for running namespace tests on save (defaults to on)
    • Caveat: Right now the tests are reported only when all are run, making it painful to run all tests in larger projects. I'll fix it. Promise!
  • Code evaluation
    • Evaluate code at cursor and show the results as annotation in the editor: ctrl+alt+v e
    • Dismiss the display of results by pressing ctrl+escape.
    • Evaluate code and replace it in the editor, inline: ctrl+alt+v r
    • Pretty printing evaluation results: ctrl+alt+v p
    • Evaluate current top level form (based on where the cursor is) and show results inline: ctrl+alt+v space
    • Send the current top level form to the REPL terminal: ctrl+alt+v alt+space
    • Error information when evaluation fails (at least a hint)
    • Support for cljc files and you can choose if they should be evaluated by the clj or the cljc repl session.
    • Enables clj repl for all files/editors. You now can evaluate those clojure code snippets in Markdown files.
    • The evaluation commands will auto-”detect” vectors and maps as well as list.
    • User setting to evaluate namespace on save/open file (defaults to on)
  • Integrated REPLs using the Terminal tab
    • Switch to current namespace in the terminal REPL: ctrl+alt+v n
    • Load current namespace in the terminal REPL: ctrl+alt+v alt+n
    • Evaluate code from the editor to the terminal REPL: ctrl+alt+v alt+e
  • When editing cljc files, easily choose if repl commands should go to the clj or cljs repl by clicking the cljc/clj[s] indicator in the status bar.
  • Selection of current form: ctrl+alt+v s. Auto-detected the same way as for evaluation. Will select the form preceding or following the * cursor first, otherwise the form the cursor is inside. (Only when the cursor is directly adjacent to any bracket so far.)

@JamesTryand
Copy link
Author

JamesTryand commented Feb 13, 2019

lein new app thing
lein repl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment