Skip to main content
This page provides a comprehensive reference for all default keybindings in Glass. You can customize keybindings in your keymap file (Ctrl+K Ctrl+S or Cmd+K Cmd+S).
Glass uses different keybindings for macOS, Linux, and Windows. This reference shows both macOS (Cmd) and Linux/Windows (Ctrl) variants where they differ.

Base Keymaps

Glass supports multiple base keymap configurations:
  • VSCode (default): Keybindings matching Visual Studio Code
  • Atom: Keybindings matching Atom editor
  • JetBrains: Keybindings matching JetBrains IDEs
  • Sublime Text: Keybindings matching Sublime Text
  • TextMate: Keybindings matching TextMate
  • Emacs: Keybindings matching Emacs
Change the base keymap in settings:
{
  "base_keymap": "VSCode"
}

Global Actions

Application

KeyActionDescription
Cmd+,Open SettingsOpen settings UI
Cmd+Alt+,Open Settings FileOpen settings JSON
Cmd+QQuitQuit application
Cmd+HHideHide application
Alt+Cmd+HHide OthersHide other applications
Cmd+MMinimizeMinimize window
Fn+F or Ctrl+Cmd+FToggle Full ScreenToggle full screen mode
Cmd+Shift+WClose WindowClose current window

Font Size

KeyActionDescription
Cmd+= or Cmd++Increase Buffer FontIncrease editor font size
Cmd+-Decrease Buffer FontDecrease editor font size
Cmd+0Reset Buffer FontReset editor font to default

File Operations

KeyActionDescription
Cmd+NNew FileCreate new file
Cmd+OOpenOpen file or folder
Cmd+SSaveSave current file
Cmd+Shift+SSave AsSave file with new name
Cmd+Alt+SSave AllSave all open files
Cmd+K SSave Without FormatSave without formatting
Cmd+WClose Active ItemClose current tab
Cmd+Shift+TReopen Closed ItemReopen last closed tab

File Finder

KeyActionDescription
Cmd+PFile FinderQuick file search
Cmd+Shift+OGo to SymbolGo to symbol in workspace
Cmd+TGo to TypeGo to type definition

Panes and Tabs

KeyActionDescription
Cmd+1-9Activate PaneSwitch to pane 1-9
Ctrl+1-9Activate TabSwitch to tab 1-9 in pane
Ctrl+0Activate Last TabSwitch to last tab
Cmd+{ or Alt+Cmd+LeftPrevious TabGo to previous tab
Cmd+} or Alt+Cmd+RightNext TabGo to next tab
Ctrl+TabTab SwitcherOpen tab switcher
Ctrl+Shift+TabTab Switcher (Reverse)Open tab switcher (last first)

Pane Splitting

KeyActionDescription
Cmd+\\Split RightSplit pane to the right
Cmd+K UpSplit UpSplit pane upward
Cmd+K DownSplit DownSplit pane downward
Cmd+K LeftSplit LeftSplit pane to the left
Cmd+K RightSplit RightSplit pane to the right

Editor

Text Editing

KeyActionDescription
Cmd+XCutCut selection
Cmd+CCopyCopy selection
Cmd+VPastePaste from clipboard
Cmd+ZUndoUndo last change
Cmd+Shift+ZRedoRedo last undone change
Cmd+/Toggle CommentsToggle line/block comments
Cmd+]IndentIndent selected lines
Cmd+[OutdentOutdent selected lines
Cmd+EnterNewline BelowInsert line below
Cmd+Shift+EnterNewline AboveInsert line above

Cursor Movement

KeyActionDescription
Cmd+Left or Ctrl+ALine StartMove to beginning of line
Cmd+Right or Ctrl+ELine EndMove to end of line
Cmd+UpFile StartMove to beginning of file
Cmd+DownFile EndMove to end of file
Alt+LeftPrevious WordMove to previous word
Alt+RightNext WordMove to next word
Ctrl+LCenter CursorScroll to center cursor

Selection

KeyActionDescription
Cmd+ASelect AllSelect entire file
Cmd+LSelect LineSelect current line
Cmd+DSelect NextSelect next occurrence
Cmd+K Cmd+DSelect Next (Skip)Move selection to next occurrence
Cmd+Shift+LSelect All MatchesSelect all occurrences
Cmd+Ctrl+LeftSelect Smaller Syntax NodeShrink selection
Cmd+Ctrl+RightSelect Larger Syntax NodeExpand selection

Multiple Cursors

KeyActionDescription
Cmd+Ctrl+P or Cmd+Alt+UpAdd Cursor AboveAdd cursor on line above
Cmd+Ctrl+N or Cmd+Alt+DownAdd Cursor BelowAdd cursor on line below
Cmd+ClickAdd Cursor at ClickAdd cursor at mouse position

Line Manipulation

KeyActionDescription
Cmd+Shift+KDelete LineDelete current line
Alt+UpMove Line UpMove line up
Alt+DownMove Line DownMove line down
Alt+Shift+UpDuplicate Line UpDuplicate line upward
Alt+Shift+DownDuplicate Line DownDuplicate line downward

Code Navigation

KeyActionDescription
F12Go to DefinitionGo to symbol definition
Alt+F12Go to Definition (Split)Open definition in split
Cmd+F12Go to Type DefinitionGo to type definition
Shift+F12Go to ImplementationGo to implementation
Alt+Shift+F12Find All ReferencesFind all references
F2RenameRename symbol
Cmd+K Cmd+IHoverShow hover information
Cmd+K Cmd+BBlame HoverShow git blame

Code Actions

KeyActionDescription
Cmd+.Toggle Code ActionsShow code actions menu
Cmd+Shift+IFormat DocumentFormat file
Alt+Shift+OOrganize ImportsOrganize imports
Ctrl+SpaceShow CompletionsShow completion suggestions

Folding

KeyActionDescription
Cmd+Alt+[FoldFold current section
Cmd+Alt+]UnfoldUnfold current section
Cmd+K Cmd+LToggle FoldToggle fold at cursor
Cmd+K Cmd+0Fold AllFold all sections
Cmd+K Cmd+JUnfold AllUnfold all sections
Cmd+K Cmd+1-9Fold at LevelFold at indentation level

Search and Replace

KeyActionDescription
Cmd+FBuffer SearchSearch in current file
Cmd+Alt+FBuffer Search (Replace)Search and replace in file
Cmd+GSelect Next MatchGo to next search result
Cmd+Shift+GSelect Previous MatchGo to previous result
Cmd+Shift+FProject SearchSearch across project
Cmd+Shift+HProject Search (Replace)Search and replace in project
Alt+EnterSelect All MatchesSelect all search matches

Panels and Docks

KeyActionDescription
Cmd+BToggle Left DockToggle project panel
Cmd+R or Cmd+Alt+BToggle Right DockToggle agent panel
Cmd+JSwitch to Terminal ModeFocus terminal
Cmd+ESwitch to Editor ModeFocus editor
Cmd+Shift+EToggle Project PanelFocus project panel
Cmd+Shift+MToggle DiagnosticsOpen diagnostics panel
Ctrl+Shift+GToggle Git PanelFocus git panel
Cmd+?Toggle AgentFocus agent panel
Cmd+Shift+PCommand PaletteOpen command palette

Terminal

KeyActionDescription
`Ctrl+“Toggle TerminalShow/hide terminal panel
Ctrl+~New TerminalCreate new terminal
Cmd+KClear TerminalClear terminal output
Cmd+CCopyCopy selected text
Cmd+VPastePaste into terminal

Git

KeyActionDescription
Cmd+Alt+G BGit BlameShow git blame
Cmd+Alt+G MOpen Modified FilesOpen all modified files
Cmd+Alt+G RReview DiffReview git diff
Cmd+YStage and NextStage hunk and move to next
Cmd+Shift+YUnstage and NextUnstage hunk and move to next
Cmd+Alt+YToggle StagedToggle staging for hunk
Cmd+Alt+ZRestoreRestore file to HEAD

Agent (AI Assistant)

KeyActionDescription
Ctrl+EnterInline AssistTrigger inline AI assistance
Cmd+>Add Selection to ThreadAdd selection to agent thread
Cmd+<Insert from AgentInsert agent response to editor
Cmd+NNew ThreadCreate new agent thread
Cmd+Alt+YKeep (Agent Diff)Accept agent suggestion
Cmd+Alt+ZReject (Agent Diff)Reject agent suggestion

Diagnostics

KeyActionDescription
F8Go to Next DiagnosticJump to next diagnostic
Shift+F8Go to Previous DiagnosticJump to previous diagnostic

Debugger

KeyActionDescription
F4Start DebuggingStart debug session
F5Continue/RerunContinue or rerun debugger
Shift+F5Stop DebuggingStop debug session
F6PausePause execution
F7Step OverStep over statement
Ctrl+F11Step IntoStep into function
Shift+F11Step OutStep out of function
F9Toggle BreakpointToggle breakpoint at line
Shift+F9Edit Log BreakpointEdit log breakpoint

Tasks

KeyActionDescription
Cmd+Shift+RSpawn TaskRun a task
Cmd+Alt+RRerun TaskRerun last task

Customizing Keybindings

To customize keybindings, open your keymap file:
Press Cmd+K Cmd+S or use Cmd+Shift+P → “zed: open keymap”
Add custom bindings in JSON format:
[
  {
    "context": "Editor",
    "bindings": {
      "ctrl+shift+d": "editor::DuplicateLine",
      "alt+/": "editor::ToggleComments"
    }
  }
]
Context determines where the keybinding is active. Common contexts include: Editor, Workspace, Terminal, ProjectPanel, Pane.

Context-Specific Bindings

Some keybindings only work in specific contexts:

Editor Context

Bindings that only work when an editor has focus:
  • Text editing operations
  • Cursor movement
  • Code navigation
  • Folding

Terminal Context

Bindings that only work in the terminal:
  • Terminal-specific copy/paste
  • Shell interactions
  • Terminal navigation

Panel Contexts

Bindings specific to panels:
  • ProjectPanel: File tree navigation
  • GitPanel: Git operations
  • AgentPanel: AI assistant interactions

Keybinding Modifiers

  • Cmd: Command key (⌘)
  • Ctrl: Control key
  • Alt or Option: Option key (⌥)
  • Shift: Shift key

Tips

  1. Avoid conflicts: Check existing keybindings before adding new ones
  2. Use contexts: Make keybindings context-specific when possible
  3. Follow conventions: Use platform-appropriate modifiers (Cmd on macOS, Ctrl on Linux/Windows)
  4. Document custom bindings: Add comments to your keymap file
  5. Test thoroughly: Ensure custom bindings don’t interfere with essential commands

Build docs developers (and LLMs) love