Skip to content

Instantly share code, notes, and snippets.

@PEZ
Last active April 15, 2025 13:59
Show Gist options
  • Save PEZ/bd4d4b88709626074293430d0b2bf14e to your computer and use it in GitHub Desktop.
Save PEZ/bd4d4b88709626074293430d0b2bf14e to your computer and use it in GitHub Desktop.
Calva custom repl commands and keybinding for Snitch
...
// --- SNITCH CONVENIENCE, Thanks, Abhinav! ♥️🙏
// https://github.com/AbhinavOmprakash/snitch
{
// Instrument as snitched defn*
"key": "cmd+enter",
"when": "editorLangId == 'clojure' && calva:connected",
"command": "calva.runCustomREPLCommand",
"args": {
"snippet": "${top-level-form|replace|^\\(defn-?|(defn*}"
}
},
{
// Check snitched defn* result
"key": "cmd+alt+s r",
"when": "editorLangId == 'clojure' && calva:connected",
"command": "calva.runCustomREPLCommand",
"args": {
"snippet": "${top-level-defined-symbol|replace|$|<}"
}
},
{
// Reconstruct last call to snitched defn* to clipboard
"key": "cmd+alt+s c",
"when": "editorLangId == 'clojure' && calva:connected",
"command": "runCommands",
"args": {
"commands": [
{
"command": "calva.runCustomREPLCommand",
"args": {
"snippet": "${top-level-defined-symbol|replace|$|>}"
}
},
"calva.copyLastResults"
]
}
},
...
"calva.customREPLCommandSnippets": [
...
{
// --- SNITCH CONVENIENCE, Thanks, Abhinav! ♥️🙏
// https://github.com/AbhinavOmprakash/snitch
"name": "qol: Add Snitch dependency",
"repl": "clj",
"snippet": "(require '[clojure.repl.deps :refer [add-libs]])\n\n(add-libs '{ org.clojars.abhinav/snitch {:mvn/version \"0.1.16\"}})\n\n(require '[snitch.core :refer [defn* defmethod* *fn *let]])"
},
...
],
@PEZ
Copy link
Author

PEZ commented Apr 11, 2025

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