Requirements: VSCode + Joyride.
You can optimize the ergonomics of using Firework's print-and-return macros by setting up a Joyride user script in VSCode. These commands can be bound to the shortcut of your choosing and will execute the wrapping and unwrapping of the current form, based on cursor location.
The toggle-fireworks.cljs Joyride script, for example, would transform:
(+ 1 1)
into
(? (+ 1 1))
Conversely, it would transform (? (+ 1 1)) into (+ 1 1).
If the ? symbol is the current form (within an existing wrapped form), the toggle-fireworks.cljs
will toggle the symbol to !? (silent version of ?), and vice-versa.
The toggle-fireworks-tap.cljs Joyride script, for example, would transform:
(+ 1 1)
into
(?> (+ 1 1))
Conversely, it would transform (?> (+ 1 1)) into (+ 1 1).
If the ?> symbol is the current form (within an existing wrapped form), the toggle-fireworks-tap.cljs
script will toggle the symbol to !?> (silent version of ?>), and vice-versa.
toggle-fireworks.cljs and toggle-fireworks-tap.cljs files into your /Users/<username>/.config/joyride/scripts.
These scripts can be found here.Open the command pallette to find the ***Preferences: Open Keyboard Shortcuts (JSON)***.
Use whichever shortcut suites you best.
{
"key": "cmd+'",
"command": "joyride.runUserScript",
"args": "fireworks.cljs"
}
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |