This is your user Joyride directory where you can create scripts that are globally available across all VS Code windows on your computer. Use it to make VS Code suit you even better.
- A Joyride Script is a file in the
scriptssubdirectory that you can run from the Joyride: Run User Script... menu. - A Joyride Source file is a file in the
srcsubdirectory. It can be library functions for Scripts, and can also expose functions that you can call from keyboard shortcut bindings, using thejoyride.runCodecommand. - User scripts and source files. Code in this directory that can be accessed and run from the Joyride User commands. User code is global to all VS Code windows.
- Workspace scripts and source files. Code in the
./joyridesubdirectory of projects you have opened in a VS Code window. Workspace code is local to the, well, workspace. - The
scriptsandsrcdirectories from both Workspace and User are part of Joyride's “classpath” and resolved in this order:<workspace-root>/.joyride/src<workspace-root>/.joyride/scripts<user-home>/.config/joyride/src<user-home>/.config/joyride/scripts
- Note that this project has both workspace and user content:
- You probably want to have this project under source control.
Use VS Code commands to create your first Joyride scripts:
- Create User Activate Script - Runs automatically when Joyride starts
- Create Hello Joyride User Script - Example script to run manually
The Awesome Copilot Script - A tool for exploring and installing GitHub Copilot instructions, prompts, and chatmodes from the Awesome Copilot repository.
- Get the script: Copy from Awesome Copilot Joyride Script
- Install in Joyride:
- Command Palette:
Joyride: Create User Script... - Name it:
awesome-copilot(NB: It's important that you name it exactly this, because reasons.) - Paste the script code
- Save the file
- Command Palette:
- Use the script:
- Command Palette:
Joyride: Run User Script... - Select:
awesome_copilot.cljs - Expect: A menu with content from the Awesome Copilot repository. Selecting an item gives you option to view or install it in your VS Code environment. See this video for a demo.
- Command Palette:
The git-fuzzy script is a simple way to search through your Git commit history using a fuzzy search. It will open previews and highlight the changes as you search and navigate the results. It is a super fast way to find changes.
- Copy the code from Joyride Example: git_fuzzy.cljs
- Run the VS Code command: Joyride: Create User Source File...
- Enter
git-fuzzyin the input box that pops up, and submit
- Enter
- In the editor that opens, Select All and paste the code you copied.
- Configure a keyboard shortcut:
{
"key": "ctrl+alt+j ctrl+alt+g",
"command": "joyride.runCode",
"args": "(require '[git-fuzzy :as gz] :reload) (gz/show-git-history!+)"
},Open some project – with a somewhat populated git repository – in another VS Code window, and use the keyboard shortcut from there. Because, if you try it in this project it will either:
- Show an error (if you haven't initialized this project for Git yet)
- Be boring (because you don't have many commits)
The code for git-fuzzy is pretty simple and could probably have plenty of more features. Like supporting to search all git repos in a multi-folder workspace. Make the script your own by hacking away on it. You can ask CoPilot for help, Sonnet 4 is pretty good with Joyride!
For the best Joyride development experience, install the Calva extension:
- Provides syntax highlighting and REPL support
- Use
Calva: Start Joyride REPL and Connectto interact with your scripts
Check out the Joyride examples repository: https://github.com/BetterThanTomorrow/joyride/tree/master/examples
- Use
Joyride: Run User Scriptto run your scripts - Scripts in this directory can access the full VS Code API
scripts/- Your Joyride scripts go heresrc/- Reusable Clojure code (created when needed)deps.edn- Clojure dependencies (created when needed)
- Read the Joyride documentation: https://github.com/BetterThanTomorrow/joyride
- Join the Joyride community: http://clojurians.net (#joyride channel)
- Join the Calva community: http://clojurians.net (#calva channel)
- Continue scripting and have fun! 🎉
