Skip to content

PEZ/dotfiles-joyride

Repository files navigation

Welcome to Joyride! 🎸

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.

Joyride Logo

Some Important Distinctions/Terms

  • A Joyride Script is a file in the scripts subdirectory that you can run from the Joyride: Run User Script... menu.
  • A Joyride Source file is a file in the src subdirectory. It can be library functions for Scripts, and can also expose functions that you can call from keyboard shortcut bindings, using the joyride.runCode command.
  • 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 ./joyride subdirectory of projects you have opened in a VS Code window. Workspace code is local to the, well, workspace.
  • The scripts and src directories from both Workspace and User are part of Joyride's “classpath” and resolved in this order:
    1. <workspace-root>/.joyride/src
    2. <workspace-root>/.joyride/scripts
    3. <user-home>/.config/joyride/src
    4. <user-home>/.config/joyride/scripts
  • Note that this project has both workspace and user content:
    • Workspace content (in the .joyride directory), relevant only to this project
    • User content (in the scripts, and src directories), relevant to all projects you open with VS Code

Getting Started

  1. You probably want to have this project under source control.

1. Create Your First Script

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

1.b Install the Awesome Copilot Script

The Awesome Copilot Script - A tool for exploring and installing GitHub Copilot instructions, prompts, and chatmodes from the Awesome Copilot repository.

  1. Get the script: Copy from Awesome Copilot Joyride Script
  2. Install in Joyride:
    1. Command Palette: Joyride: Create User Script...
    2. Name it: awesome-copilot (NB: It's important that you name it exactly this, because reasons.)
    3. Paste the script code
    4. Save the file
  3. Use the script:
    1. Command Palette: Joyride: Run User Script...
    2. Select: awesome_copilot.cljs
    3. 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.

1.c Install the example git-fuzzy search function/command

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.

  1. Copy the code from Joyride Example: git_fuzzy.cljs
  2. Run the VS Code command: Joyride: Create User Source File...
    1. Enter git-fuzzy in the input box that pops up, and submit
  3. In the editor that opens, Select All and paste the code you copied.
  4. 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:

  1. Show an error (if you haven't initialized this project for Git yet)
  2. 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!

2. Install Calva (Recommended)

For the best Joyride development experience, install the Calva extension:

  • Provides syntax highlighting and REPL support
  • Use Calva: Start Joyride REPL and Connect to interact with your scripts

3. Explore Examples

Check out the Joyride examples repository: https://github.com/BetterThanTomorrow/joyride/tree/master/examples

4. Run Scripts

  • Use Joyride: Run User Script to run your scripts
  • Scripts in this directory can access the full VS Code API

Directory Structure

  • scripts/ - Your Joyride scripts go here
  • src/ - Reusable Clojure code (created when needed)
  • deps.edn - Clojure dependencies (created when needed)

Next Steps

About

A mess

Topics

Resources

Stars

Watchers

Forks