Base Keymap
Glass supports several base keymaps that provide familiar shortcuts from other editors:settings.json
Available options:
"VSCode"- Visual Studio Code keybindings"Atom"- Atom editor keybindings"JetBrains"- JetBrains IDEs keybindings"SublimeText"- Sublime Text keybindings"TextMate"- TextMate keybindings"None"- Minimal default keybindings
The base keymap provides default keybindings. Your custom keybindings in
keymap.json will override these defaults.Keymap File
Custom keybindings are defined in~/.config/glass/keymap.json (or equivalent on your platform). The keymap file contains an array of binding contexts:
keymap.json
Binding Structure
Each keybinding consists of:- Context - Where the keybinding is active
- Keystroke - The key combination to trigger the action
- Action - The command to execute
- Arguments (optional) - Parameters passed to the action
Context Predicates
Contexts determine when keybindings are active. Common contexts include:Workspace- Active in any workspaceEditor- Active when an editor has focusTerminal- Active in terminal panesPicker- Active in pickers and modalsProjectPanel- Active in the file treePane- Active in any pane
keymap.json
&&- Logical AND||- Logical OR!- Logical NOT==- Equality check!=- Inequality check
Keystroke Syntax
Keybindings use a string format with modifiers and keys:Platform Modifiers
Modifiers adapt to your platform:ctrl- Control on Linux/Windows, Command on macOSalt- Alt on Linux/Windows, Option on macOSshift- Shift on all platformscmd- Command (macOS only)
Action Arguments
Many actions accept optional arguments:keymap.json
Keymap Editor
Glass includes a visual keymap editor for managing keybindings: Open the keymap editor:- Command Palette:
zed: open keymap - Menu: Settings → Keymap
Features
- Search & Filter
- Edit Bindings
- Conflict Detection
- Action search - Filter by action name with fuzzy matching
- Keystroke search - Find bindings by keyboard shortcut
- Conflict filter - Show only conflicting keybindings
- Exact matching - Toggle exact keystroke matching
crates/keymap_editor/ and provides real-time validation and conflict detection.
Common Actions
Frequently customized actions:Discovering Actions
To find action names for keybindings:- Command Palette - Search for commands and view their action names
- Keymap Editor - Browse all available actions
- Default Keymap - View the base keymap with
zed: open default keymap - Documentation - Action names are listed with keyboard shortcuts throughout the docs
Keymap File Location
Keymap configuration files are stored in:- Linux:
~/.config/glass/keymap.json - macOS:
~/Library/Application Support/Glass/keymap.json - Windows:
%APPDATA%\Glass\keymap.json
assets/keymaps/ in the source tree:
default-macos.jsondefault-linux.jsondefault-windows.json
Reloading Keymaps
Keybindings are automatically reloaded when you save yourkeymap.json file. Changes take effect immediately without restarting Glass.
The keymap system is managed by the KeymapFile and SettingsStore in crates/settings/, with live reload triggered through the KeymapEventChannel.