Last active
April 15, 2025 13:59
-
-
Save PEZ/bd4d4b88709626074293430d0b2bf14e to your computer and use it in GitHub Desktop.
Calva custom repl commands and keybinding for Snitch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// --- 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" | |
] | |
} | |
}, | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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]])" | |
}, | |
... | |
], |
Author
PEZ
commented
Apr 11, 2025
- Snitch: https://github.com/AbhinavOmprakash/snitch
- Intro to Snitch and these Calva bindings: https://youtu.be/jb1BcYpyOAs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment