Skip to content

Instantly share code, notes, and snippets.

@julienrbrt
Last active July 28, 2025 13:47
Show Gist options
  • Select an option

  • Save julienrbrt/bb4a2efa7c076ef63c139b2445ba45cc to your computer and use it in GitHub Desktop.

Select an option

Save julienrbrt/bb4a2efa7c076ef63c139b2445ba45cc to your computer and use it in GitHub Desktop.

Revisions

  1. julienrbrt renamed this gist Jul 28, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. julienrbrt revised this gist Jul 28, 2025. 1 changed file with 5 additions and 7 deletions.
    12 changes: 5 additions & 7 deletions tasks.json
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,12 @@
    [
    {
    {
    "label": "JSON-to-Go",
    "command": "node $HOME/tools/scripts/json-to-go.js <<< '$ZED_SELECTED_TEXT'",
    "command": "tempfile=$(mktemp --suffix=.go) && node $HOME/tools/scripts/json-to-go.js <<< '$ZED_SELECTED_TEXT' > \"$tempfile\" && zed \"$tempfile\"",
    "use_new_terminal": false,
    "allow_concurrent_runs": false,
    "reveal": "never",
    "reveal_target": "center",
    "hide": "never",
    "shell": "system",
    "show_summary": false,
    "show_command": false
    "reveal_target": "dock",
    "hide": "on_success",
    "shell": "system"
    }
    ]
  3. julienrbrt created this gist Jul 28, 2025.
    8 changes: 8 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # JSON-to-Go Zed Editor

    This is a Zed Task for [JSON-to-Go](https://github.com/mholt/json-to-go).
    I was using the [VSCode extension](https://github.com/mp3cko/json-to-go-vsc) prior to moving to Zed.

    Adding this snippet to your ~/.config/zed/tasks.json plus a shortcut in the ~/.config/zed/keymap.json brings back most of the basic functionalities.

    Another prerequisite is to have `node` installed and the [`json-to-go.js`](https://raw.githubusercontent.com/mholt/json-to-go/refs/heads/master/json-to-go.js) script placed at the location defined in your `tasks.json`
    8 changes: 8 additions & 0 deletions keymap.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    [
    {
    "context": "Workspace",
    "bindings": {
    "alt-g": ["task::Spawn", { "task_name": "JSON-to-Go" }]
    }
    },
    ]
    14 changes: 14 additions & 0 deletions tasks.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    [
    {
    "label": "JSON-to-Go",
    "command": "node $HOME/tools/scripts/json-to-go.js <<< '$ZED_SELECTED_TEXT'",
    "use_new_terminal": false,
    "allow_concurrent_runs": false,
    "reveal": "never",
    "reveal_target": "center",
    "hide": "never",
    "shell": "system",
    "show_summary": false,
    "show_command": false
    }
    ]