Liking cljdoc? Tell your friends :D

Using Fireworks with VSCode + Joyride

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.


Setting up the Fireworks Joyride user scripts


  1. Install the Joyride extension in your VSCode.

  1. Familiarize yourself with the basic concepts of how Joyride works, and how it executes user scripts, where they live on your computer, etc. Start here

  1. Copy the toggle-fireworks.cljs and toggle-fireworks-tap.cljs files into your /Users/<username>/.config/joyride/scripts. These scripts can be found here.

Setting up keybindings

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

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close