{"id":15722552,"url":"https://github.com/astrochili/defold-zed","last_synced_at":"2025-05-13T03:59:12.280Z","repository":{"id":169278606,"uuid":"645189275","full_name":"astrochili/defold-zed","owner":"astrochili","description":"Any ideas and settings for using the Zed editor for Lua / Defold development","archived":false,"fork":false,"pushed_at":"2025-03-21T22:40:35.000Z","size":81,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T03:59:06.657Z","etag":null,"topics":["defold","zed"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrochili.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-05-25T05:48:32.000Z","updated_at":"2025-03-21T22:40:38.000Z","dependencies_parsed_at":"2024-06-12T13:12:43.986Z","dependency_job_id":"8392eb46-a726-44f1-8e50-fae5467d569f","html_url":"https://github.com/astrochili/defold-zed","commit_stats":null,"previous_names":["astrochili/defold-zed"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fdefold-zed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fdefold-zed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fdefold-zed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrochili%2Fdefold-zed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrochili","download_url":"https://codeload.github.com/astrochili/defold-zed/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870858,"owners_count":21976612,"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","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":["defold","zed"],"created_at":"2024-10-03T22:08:22.259Z","updated_at":"2025-05-13T03:59:12.252Z","avatar_url":"https://github.com/astrochili.png","language":"Lua","funding_links":[],"categories":["Tools"],"sub_categories":["Code Editor"],"readme":"# Zed + Defold\n\nHere I collect any ideas on how to adapt the [Zed](https://zed.dev/) editor for Defold game development.\n\nThe editor is now in an active stage of development, so many things are still to come. I plan to keep an eye on it and catch useful updates.\n\n## Settings\n\nZed by default uses a 4 space indent for Lua. To fix this, add the following to [`settings.json`](.zed/settings.json):\n\n```json\n\"language_overrides\": {\n  \"Lua\": {\n    \"tab_size\": 2\n  }\n}\n```\n\nAlso add Lua file associations:\n\n```json\n\"file_types\": {\n  \"Lua\": [\"script\", \"render_script\", \"gui_script\", \"editor_script\"]\n}\n```\n\n## Lua Language Server\n\nZed already includes [Lua Language Server](https://github.com/LuaLS/lua-language-server) and all we have to do is setup the [`.luarc.json`](.luarc.json) file.\n\nIt would be better to share it between projects somewhere, but don't know how to do it yet.\n\n## Defold API\n\nDefold API annotations can be downloaded from [here](https://github.com/astrochili/defold-annotations/releases).\n\nIt would be a good idea to place them to some shared place and add the path to `workspace.library` array in the `.luarc.json` file. It allows to reuse the annotations folder between projects.\n\nIn the example it's `~/Library/Application Support/Code/User/globalStorage/astronachos.defold` for macOS because I also use [Defold Kit](https://github.com/astrochili/vscode-defold/) for VSCode.\n\n## Libraries API\n\nSame story. At the moment I sync libraries API with [Defold Kit](https://github.com/astrochili/vscode-defold/) and then copy the unique path to the workspace annotations froms `.vscode/settings.json` to `.luarc.json`.\n\n## Build\n\nThe [`build.sh`](build.sh) file is an example how to build and run a game with Defold `1.9.8` on macOS. For other versions or platforms you need to adapt it.\n\n\u003e A more detailed reference of the shell script is [here](https://github.com/astrochili/vscode-defold/blob/4b0408306b3bdc759b7c28f12c5f79a54eb2c1a0/.vscode/defold.sh).\n\n\nThere are tasks `build`, `resolve`, `clean`, `distclean` provided by [`.zed/tasks.json`](.zed/tasks.json) file.\n\nThe easiest way to run the task is creating a keybinding `Cmd+R` in the general `keymap.json` file:\n\n```js\n[\n  {\n    \"context\": \"Workspace\",\n    \"bindings\": {\n      \"cmd-r\": [\"task::Spawn\", { \"task_name\": \"build\" }]\n    }\n  }\n]\n```\n\n## Debug\n\nNo way to do it natively with Zed. Upvote and watch for updates [zed-industries/community/issues/811](https://github.com/zed-industries/community/issues/811).\n\n### debugger.lua\n\nThere is a minimalistic [debugger.lua](debugger.lua) that may help if the need for debugging is modest and infrequent and you would like to do it inside Zed environment. It required some edits to work with Defold, so this is an adapted version without using `ffi` and `require`.\n\nA simple example:\n\n```lua\n-- Require it globally\ndbg = require 'debugger'\n\n-- Call a breakpoint\ndbg()\n```\n\nTo understand how to interact with it, check out the original repository [slembcke/debugger.lua](https://github.com/slembcke/debugger.lua).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrochili%2Fdefold-zed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrochili%2Fdefold-zed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrochili%2Fdefold-zed/lists"}