Central Zed editor configuration for the dotfiles.
zed/
.config/zed/
settings.json # Settings (with $schema)
keymap.json # Keyboard shortcuts
tasks.json # Global tasks
snippets/ # Code snippets
snippets.json # Global snippets
# Via install.sh or manually:
cd ~/.dotfiles && stow zed| File | Shortcut | Command Palette |
|---|---|---|
| settings.json | Cmd+, |
zed: open settings |
| keymap.json | Cmd+K Cmd+S |
zed: open keymap |
| tasks.json | - | zed: open tasks |
| snippets/ | - | snippets: open folder |
Schema: https://zed.dev/schema/settings.json
All settings: https://zed.dev/docs/reference/all-settings
Documentation: https://zed.dev/docs/key-bindings
[
{
"context": "Editor",
"bindings": {
"cmd-shift-d": "editor::DuplicateLine"
}
}
]| Context | Description |
|---|---|
Editor |
In text editor |
Workspace |
General |
Terminal |
In terminal |
ProjectPanel |
File tree |
Pane |
Editor pane |
- Modifiers:
cmd,ctrl,alt,shift - Combining:
cmd-shift-p - Sequences:
cmd-k cmd-s
[
{
"context": "Editor",
"bindings": {
"cmd-shift-d": "editor::DuplicateLine",
"cmd-shift-k": "editor::DeleteLine",
"cmd-shift-l": "editor::SelectAllMatches"
}
},
{
"context": "Terminal",
"bindings": {
"cmd-k": "terminal::Clear"
}
}
]Documentation: https://zed.dev/docs/tasks
[
{
"label": "Task Name",
"command": "command to run",
"cwd": "$ZED_WORKTREE_ROOT",
"reveal": "always"
}
]| Property | Description |
|---|---|
label |
Display name (required) |
command |
Shell command (required) |
args |
Argument array |
cwd |
Working directory |
env |
Environment variables |
reveal |
always / never |
hide |
always / never / on_success |
| Variable | Description |
|---|---|
$ZED_WORKTREE_ROOT |
Project root |
$ZED_FILE |
Current file |
$ZED_FILENAME |
Filename |
$ZED_DIRNAME |
Directory |
$ZED_STEM |
Filename without extension |
$ZED_SELECTED_TEXT |
Selected text |
[
{
"label": "npm install",
"command": "npm install",
"cwd": "$ZED_WORKTREE_ROOT"
},
{
"label": "go run",
"command": "go run $ZED_FILE"
},
{
"label": "cargo build",
"command": "cargo build",
"cwd": "$ZED_WORKTREE_ROOT"
},
{
"label": "docker compose up",
"command": "docker compose up -d",
"hide": "on_success"
}
]Documentation: https://zed.dev/docs/snippets
Create language-specific files:
snippets.json- Global (all languages)javascript.json,typescript.jsonpython.json,rust.json,go.jsonhtml.json,css.json,markdown.json
{
"Snippet Name": {
"prefix": "trigger",
"body": "expanded text",
"description": "Description"
}
}| Syntax | Description |
|---|---|
$1, $2 |
Tab stops |
${1:default} |
With default value |
${1|a,b,c|} |
With choices |
$0 |
Final cursor position |
$TM_FILENAME |
Filename |
$CLIPBOARD |
Clipboard content |
$CURRENT_YEAR |
Current year |
{
"Console Log": {
"prefix": "cl",
"body": "console.log('$1:', $1);$0",
"description": "Console log with label"
},
"TODO": {
"prefix": "todo",
"body": "// TODO: $1$0",
"description": "TODO comment"
},
"Insert Date": {
"prefix": "date",
"body": "$CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE",
"description": "Current date"
}
}Extensions are stored in ~/Library/Application Support/Zed/extensions/.
Auto-install in settings.json:
{
"auto_install_extensions": {
"catppuccin": true,
"docker-compose": true
}
}