Settings Files
Glass uses multiple settings files that are merged with a specific precedence:- Default settings - Built-in defaults (
assets/settings/default.json) - User settings - Your personal configuration (
~/.config/glass/settings.json) - Project settings - Project-specific settings (
.glass/settings.jsonin project root) - Local settings - Directory-specific settings (
.glass/settings.jsonin subdirectories)
Settings from higher-precedence files override settings from lower-precedence files. Project and local settings override user settings, which override defaults.
Opening Settings
Access settings through multiple methods:- Command Palette:
zed: open settings- Opens the settings UI - Command Palette:
zed: open settings file- Openssettings.jsondirectly - Command Palette:
zed: open default settings- View all default settings - Menu: Settings → Open Settings
- Keyboard:
Cmd+,(macOS) orCtrl+,(Linux/Windows)
Settings File Format
Settings are stored as JSON with comments support:settings.json
Common Settings
Editor Settings
Workspace Settings
settings.json
When to automatically save files:
"off"- Never autosave"on_focus_change"- Save when switching files/apps"on_window_change"- Save when switching windows"after_delay"- Save after a delay (seeautosave_delay)
What to restore on startup:
"last_session"- Restore all workspaces from last session"last_workspace"- Restore only the last workspace"none"- Start with empty workspace
Terminal Settings
settings.json
Language-Specific Settings
Override settings for specific programming languages:settings.json
Number of spaces per indentation level
How to format code:
"language_server"- Use the LSP formatter"prettier"- Use Prettier"auto"- Auto-detect formatter
When to format on save:
"on"- Always format"off"- Never format"language_server"- Format using LSP only
LSP Settings
Configure language servers:settings.json
Project Settings
Project-specific settings are stored in.glass/settings.json in your project root:
.glass/settings.json
Settings Profiles
Glass supports settings profiles for different workflows:settings.json
Platform-Specific Settings
Override settings per operating system:settings.json
Settings Store
The settings system is implemented incrates/settings/ with these key components:
- SettingsStore - Global settings state management
- SettingsFile - JSON file parsing and merging
- Settings trait - Type-safe settings access
- EditorConfig - Support for
.editorconfigfiles
SettingsStore::observe_global mechanism.
Settings Location
Settings files are stored in:- Linux:
~/.config/glass/settings.json - macOS:
~/Library/Application Support/Glass/settings.json - Windows:
%APPDATA%\Glass\settings.json
.glass/settings.json relative to your project root.
Validation & Schema
Glass provides JSON schema validation for settings:settings.json
- Autocomplete - Suggestions for valid setting names and values
- Validation - Real-time error checking
- Documentation - Inline descriptions for each setting