Keymap File
Keybindings are configured in~/.config/zed/keymap.json.
To open your keymap file:
- Command Palette: “zed: open keymap”
- Or manually edit
~/.config/zed/keymap.json
Base Keymaps
Zed provides several base keymaps that emulate other editors:Keymap Structure
The keymap file is a JSON array of binding objects:Context
Thecontext field specifies where the keybinding is active:
"Editor"- Active when editing text"Workspace"- Active anywhere in the workspace"Terminal"- Active in terminal panes"ProjectPanel"- Active in the project panel"BufferSearchBar"- Active in the find bar"EmptyPane"- Active when no editor is open"VimControl"- Active in Vim normal mode"VimInsert"- Active in Vim insert mode"VimVisual"- Active in Vim visual mode
Bindings Format
Each binding maps a key combination to an action:Modifier Keys
cmd- Command key (macOS) / Windows key (Windows) / Super key (Linux)ctrl- Control keyalt- Alt/Option keyshift- Shift key
-:
Key Sequences
Multiple key combinations can create sequences, separated by spaces:cmd-k, then cmd-b to toggle the left dock.
Special Keys
- Function keys:
f1,f2, …,f12 - Arrow keys:
up,down,left,right - Navigation:
pageup,pagedown,home,end - Editing:
enter,return,tab,space,backspace,delete,escape
Action Format
Simple Actions
Actions with Arguments
Some actions accept parameters:Multiple Actions
Execute multiple actions with one keybinding:Common Keybinding Examples
File Operations
Editor Navigation
Text Editing
Split and Pane Management
Panel Toggles
Terminal
Debugging
Vim Mode Keybindings
When Vim mode is enabled, you can customize Vim-specific keybindings:Disabling Keybindings
To disable a default keybinding, set it tonull:
Discovering Actions
To find available actions:- Open the Command Palette (
cmd-shift-p) - Search for an action
- The action identifier is shown in the list
- The default keymaps in Zed’s source:
assets/keymaps/ - The Zed documentation for action references
Key Equivalents
Some contexts support system-level key equivalents (menu accelerators):Platform-Specific Keybindings
Keymap files are platform-specific by default. Zed uses:keymap.jsonon Linux and Windowskeymap.jsonon macOS
cmd modifier automatically maps to the appropriate key on each platform:
- macOS: Command key
- Windows: Windows key
- Linux: Super key
Troubleshooting
Keybinding Not Working
- Check if another keybinding overrides it (user bindings take precedence)
- Verify the context matches your current focus
- Ensure the action name is correct
- Check for JSON syntax errors in your keymap file
Finding Key Conflicts
Zed will show a warning if multiple keybindings conflict. Check the logs:- Command Palette: “zed: open logs”
Resetting to Defaults
To reset keybindings to default:- Delete or rename
~/.config/zed/keymap.json - Restart Zed
base_keymap.