{"id":20033076,"url":"https://github.com/ocsmit/zed-r","last_synced_at":"2026-01-04T14:15:46.034Z","repository":{"id":223950040,"uuid":"761994177","full_name":"ocsmit/zed-r","owner":"ocsmit","description":"R language support for Zed editor","archived":false,"fork":false,"pushed_at":"2025-06-12T16:22:33.000Z","size":62,"stargazers_count":31,"open_issues_count":5,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-12T17:31:39.497Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Tree-sitter Query","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocsmit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-22T21:55:11.000Z","updated_at":"2025-06-12T16:22:37.000Z","dependencies_parsed_at":"2024-02-22T23:23:05.904Z","dependency_job_id":"3c4da4b4-054b-45b1-91f3-7cc0a619baa0","html_url":"https://github.com/ocsmit/zed-r","commit_stats":null,"previous_names":["ocsmit/zed-r"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/ocsmit/zed-r","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsmit%2Fzed-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsmit%2Fzed-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsmit%2Fzed-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsmit%2Fzed-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocsmit","download_url":"https://codeload.github.com/ocsmit/zed-r/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocsmit%2Fzed-r/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267723924,"owners_count":24134238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T09:44:26.895Z","updated_at":"2026-01-04T14:15:46.022Z","avatar_url":"https://github.com/ocsmit.png","language":"Tree-sitter Query","funding_links":[],"categories":["🌐 Languages"],"sub_categories":[],"readme":"# zed-r\n\nProvides [tree-sitter](https://tree-sitter.github.io/tree-sitter/) queries and [Language Server Protocol (LSP)](https://github.com/REditorSupport/languageserver?tab=readme-ov-file) support for Zed.\n\n# Installing\n\nThe latest version can be installed from the Zed extensions menu, or by cloning the repo and installing it locally from the Zed extensions menu.\n\nAdditionally, it is recommended to run R code using Zed's REPL feature. To enable this, install either the Ark or Xeus Jupyter kernels; then in an R file create a REPL cell by typing `# %%` (or by using the shortcut available [below](https://github.com/ocsmit/zed-r/#rstudio-keybindings)) and run it by pressing `ctrl-shift-enter`.\n\nFurther information can be found at:\n  - https://zed.dev/docs/languages/r\n  - https://zed.dev/docs/repl\n\n# LSP\n\nThe R packages `languageserver` and `lintr` are needed.\n\n# RStudio keybindings\n\n  - Add this to your keymap.json by opening the command palette (Ctrl+Shift+P) and selecting `zed: open keymap`.\n\n  **Note: macOS users will likely want to replace `ctrl` with `cmd`.**\n\n```json\n  {\n    \"context\": \"Editor\",\n    \"bindings\": {\n      \"ctrl-shift-f10\": \"repl::Restart\", // Equivalent to restarting R in RStudio\n      \"ctrl-\\\\\": \"assistant::InlineAssist\",\n      \"ctrl-shift-m\": [\"workspace::SendKeystrokes\", \"space |\u003e space\"],\n      \"alt--\": [\"workspace::SendKeystrokes\", \"space \u003c - space\"],\n      \"ctrl-alt-i\": [\"workspace::SendKeystrokes\", \"\\n# space %%\\n\"],\n      \"ctrl-shift-d\": [\n        \"task::Spawn\",\n        { \"task_name\": \"Document local R package\", \"reveal_target\": \"center\" }\n      ],\n      \"ctrl-alt-enter\": [\n        \"workspace::SendKeystrokes\",\n        \"ctrl-c ctrl-` ctrl-shift-v enter ctrl-`\"\n      ]\n    }\n  },\n  {\n    \"context\": \"Workspace\",\n    \"bindings\": {\n      \"ctrl-shift-t\": [\n        \"task::Spawn\",\n        { \"task_name\": \"Run all R tests\", \"reveal_target\": \"center\" }\n      ],\n      \"ctrl-shift-r\": [\n        \"task::Spawn\",\n        { \"task_name\": \"Run current R file test\", \"reveal_target\": \"center\" }\n      ],\n      \"ctrl-shift-b\": [\n        \"task::Spawn\",\n        { \"task_name\": \"Install local R package\", \"reveal_target\": \"center\" }\n      ],\n      \"ctrl-2\": [\n        \"task::Spawn\",\n        { \"task_name\": \"R Terminal\", \"reveal_target\": \"dock\" }\n      ],\n      \"ctrl-shift-s\": [\n        \"task::Spawn\",\n        { \"task_name\": \"Source current file\", \"reveal_target\": \"center\"}\n      ],\n      \"ctrl-shift-e\": [\n        \"task::Spawn\",\n        { \"task_name\": \"Check local R package\", \"reveal_target\": \"center\"}\n      ]\n    }\n  }\n```\n\n# Tasks for R (works with RStudio keybindings)\n\n  - Add this to your tasks.json by opening the command palette (Ctrl+Shift+P) and selecting `zed: open tasks`\n\n```json\n[\n  {\n    \"label\": \"R Terminal\",\n    \"command\": \"R\", // You could also use [radian](https://github.com/randy3k/radian)\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"use_new_terminal\": true\n  },\n  {\n    \"label\": \"Install local R package\",\n    \"command\": \"R CMD INSTALL .\",\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"use_new_terminal\": false,\n    \"allow_concurrent_runs\": false,\n    \"reveal\": \"always\",\n    \"show_summary\": true,\n    \"show_output\": true,\n    \"show_error\": true\n  },\n  {\n    \"label\": \"Document local R package\",\n    \"command\": \"Rscript -e \\\"devtools::document(roclets = c('rd', 'collate', 'namespace'))\\\"\",\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"use_new_terminal\": false,\n    \"allow_concurrent_runs\": false\n  },\n  {\n    \"label\": \"Check local R package\",\n    \"command\": \"Rscript -e \\\"devtools::check()\\\"\",\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"use_new_terminal\": false,\n    \"allow_concurrent_runs\": false\n  },\n  {\n    \"label\": \"Run all R tests\",\n    \"command\": \"Rscript -e \\\"testthat::test_dir('tests/testthat')\\\"\",\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"use_new_terminal\": false,\n    \"allow_concurrent_runs\": false,\n    \"reveal\": \"always\",\n    \"show_summary\": true,\n    \"show_output\": true\n  },\n  {\n    \"label\": \"Run current R file test\",\n    \"command\": \"Rscript -e \\\"testthat::test_file('$ZED_RELATIVE_FILE')\\\"\",\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"use_new_terminal\": false,\n    \"allow_concurrent_runs\": false,\n    \"reveal\": \"always\",\n    \"show_summary\": true,\n    \"show_output\": true\n  },\n  {\n    \"label\": \"Run test_that test\", // Can be triggered, without a keyboard shortcut\n    // or clicking on the run button, by toggling the code action menu (Ctrl+.)\n    \"command\": \"Rscript\",\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"args\": [\n      \"-e\",\n      \"\\\"testthat::test_file(\\\\\\\"${ZED_FILE}\\\\\\\", desc = \\\\\\\"${ZED_CUSTOM_desc}\\\\\\\")\\\"\"\n    ],\n    \"tags\": [\"r-test\"]\n  },\n  {\n    \"label\": \"Source current file\",\n    \"command\": \"Rscript -e \\\"source('$ZED_RELATIVE_FILE', echo = TRUE)\\\"\",\n    \"cwd\": \"$ZED_WORKTREE_ROOT\",\n    \"use_new_terminal\": false,\n    \"allow_concurrent_runs\": false,\n    \"reveal\": \"always\",\n    \"show_summary\": true,\n    \"show_output\": true\n  }\n]\n```\n\n  - For a different keyboard shortcut for tasks, read [this section](https://zed.dev/docs/tasks#custom-keybindings-for-tasks) in the official Zed documentation.\n\n# Caveats\n  - A custom startup message in `.Rprofile` can potentially cause the the LSP message headers to be decoded improperly and prevent the language server from starting in Zed ([#7](https://github.com/ocsmit/zed-r/issues/7)).\n\n\n# Known issues\n\nCheck out the project's [issue list](https://github.com/ocsmit/zed-r/issues) for a list of unresolved issues. Feel free to fix any of them and send us a pull request!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focsmit%2Fzed-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focsmit%2Fzed-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focsmit%2Fzed-r/lists"}