Skip to content

Commit 5feedc8

Browse files
docs: Document Zed editor integration
1 parent 00431d4 commit 5feedc8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,60 @@ flatplay
1818
# This will attempt to build and run the project.
1919
```
2020

21+
## Integrate into editors
22+
23+
### Zed
24+
25+
To integrate flatplay in Zed you can define custom tasks and key bindings.
26+
27+
Add the following tasks to your `tasks.json` file (you can open it with the `zed: open tasks` action):
28+
29+
```json
30+
{
31+
"label": "build & run flatpak",
32+
"command": "flatplay build-and-run"
33+
},
34+
{
35+
"label": "build flatpak",
36+
"command": "flatplay build"
37+
},
38+
{
39+
"label": "run flatpak",
40+
"command": "flatplay run"
41+
},
42+
{
43+
"label": "stop flatpak",
44+
"command": "flatplay stop"
45+
},
46+
{
47+
"label": "clean flatpak build",
48+
"command": "flatplay clean"
49+
},
50+
{
51+
"label": "update flatpak dependencies",
52+
"command": "flatplay update-dependencies"
53+
},
54+
{
55+
"label": "select flatpak manifest",
56+
"command": "flatplay select-manifest"
57+
}
58+
```
59+
60+
Next, add new bindings to your `keymaps.json` file (you can open it with the `zed: open keypam` action):
61+
62+
```json
63+
{
64+
"context": "Workspace",
65+
"bindings": {
66+
"ctrl-alt-b": ["task::Spawn", { "task_name": "build & run flatpak" }],
67+
"ctrl-alt-r": ["task::Spawn", { "task_name": "run flatpak" }],
68+
"ctrl-alt-c": ["task::Spawn", { "task_name": "stop flatpak" }]
69+
}
70+
},
71+
```
72+
73+
Then you can run any of the tasks by pressing `Alt-Shift-T`, or use `Ctrl-Alt-B`, `Ctrl-Alt-R` or `Ctrl-Alt-C` to build & run, run or stop flatpaks.
74+
2175
# Some notes
2276

2377
- A lot of the code is almost directly borrowed from [`flatpak-vscode`](https://github.com/bilelmoussaoui/flatpak-vscode).

0 commit comments

Comments
 (0)