Zed Integration
Learn how to use CodeSnap with Zed editor
Integrate CodeSnap with Zed is straightforward. Zed provides a powerful feature called "Tasks" that allows you to run commands directly from the editor. This makes it easy to generate code snippets using CodeSnap.
Let's walk through the steps to set up CodeSnap in Zed:
Step 1: Install CodeSnap
Follow the Installation instructions to install CodeSnap CLI in your system.
Step 2: Create a Task in Zed
Recommend to create a global task in Zed for CodeSnap, so you can use it across all your projects. To do this, follow these steps:
- Create a file named
tasks.json
in your Zed configuration directory (usually~/.config/zed
). - Add the following content to the
tasks.json
file:
Step 3: Take a code snapshot
- Open the file you want to take a snapshot of in Zed.
- Select the code you want to include in the snapshot.
- Open the command palette (usually
Cmd+Shift+P
orCtrl+Shift+P
). - Type
task:spawn
and select theCodeSnap
task you created. - The code snapshot will be generated and copied to your clipboard.