Skip to main content

Keybinding Maps

Fresh provides several built-in keybinding maps to match different editing styles:
Standard keybindings inspired by modern editors like VS Code:
  • Ctrl+P - Quick open (files, commands, buffers)
  • Ctrl+S - Save file
  • Ctrl+Z / Ctrl+Y - Undo / Redo
  • Ctrl+F - Find in file
  • Arrow keys for navigation
  • Shift+Arrow for selection

Switching Keymaps

Change the active keymap in your config.json:
config.json
Available maps:
  • "default" - Standard editor keybindings
  • "emacs" - Emacs-style keybindings
  • "vscode" - VS Code keybindings
  • "macos" - macOS terminal-friendly keybindings
  • "macos-gui" - macOS GUI keybindings
On macOS, Fresh defaults to the "macos" keymap which handles terminal-specific keyboard limitations.
You can also switch keymaps at runtime:
  • Via menu: View → Keybinding Style → [Select keymap]
  • Via command palette: Ctrl+P then type >switch keybinding map

Custom Keybindings

Add custom keybindings to override the active keymap:
config.json

Keybinding Structure

Key Names

Letter keys: "a", "b", "c", … "z", "A", "B", … Special keys:
  • "Enter", "Tab", "Backspace", "Delete", "Escape"
  • "Space", "Home", "End", "PageUp", "PageDown"
  • "Left", "Right", "Up", "Down"
  • "F1""F12"
Modifier keys: "ctrl", "shift", "alt"

Context Conditions

Example: Custom Keybindings

Chord Keybindings

Define multi-key sequences (like Emacs C-x C-s):

Custom Keymaps

Create your own named keymaps:
config.json
Custom keymaps can inherit from built-in maps and add or override specific bindings.

Common Actions

Here are some frequently used actions for custom keybindings:

File Operations

Editing

LSP

UI

Viewing Current Keybindings

To see all active keybindings:
  1. Command palette: Ctrl+P>Show Keybindings
  2. Menu: Help → Keyboard Shortcuts
  3. Direct file: View the keymap file at keymaps/[name].json

macOS Terminal Configuration

macOS terminals have specific keyboard limitations. See the complete guide below:

macOS Keymap

Fresh includes a dedicated macOS keymap that addresses terminal-specific challenges. To use it:
The macOS keymap works around these limitations:Ctrl+Shift combinations don’t work. Some macOS terminals cannot reliably send Ctrl+Shift sequences. The macOS keymap uses Ctrl+Alt as an alternative modifier.Some Ctrl keys are ASCII control characters. Terminal protocols treat Ctrl+J as Line Feed, Ctrl+M as Carriage Return, and Ctrl+I as Tab. The macOS keymap avoids these collisions.International keyboards use Alt for essential characters. On German, French, and other ISO layouts, Alt (Option) combined with letters produces characters like @, [, ], {, }. The macOS keymap avoids blocking character input.

iTerm2 Setup

  1. Go to SettingsProfilesKeys
  2. Check Report keys using CSI u
  3. Set Left Option key to Esc+
  4. Set Right Option key to Normal (for special characters)

Terminal.app Setup

Import Profile (easiest):
  1. Locate scripts/macOS/Fresh.terminal in the repository
  2. In Terminal.app, go to SettingsProfiles
  3. Click the gear icon and select Import…
  4. Select the Fresh.terminal file
Manual Configuration:
  1. Settings → Profiles → Keyboard → Check Use Option as Meta key
  2. Add key mappings for Shift+Arrow keys:
    • Shift+Up: \033[1;2A
    • Shift+Down: \033[1;2B
    • Shift+Left: \033[1;2D
    • Shift+Right: \033[1;2C

Mission Control Conflicts

macOS uses Ctrl+Arrow for desktop switching. To use Ctrl+Arrow in Fresh:
  1. Open System SettingsKeyboardKeyboard ShortcutsMission Control
  2. Disable or rebind:
    • “Move left a space” (Ctrl+Left)
    • “Move right a space” (Ctrl+Right)
    • “Mission Control” (Ctrl+Up)
    • “Application windows” (Ctrl+Down)

Keyboard Enhancement Flags

Configure advanced keyboard protocol features:
config.json
If you experience keyboard issues, try disabling all flags by setting them to false.

Linux: XFCE Window Manager

XFCE captures Ctrl+Alt+Up/Down for workspace switching. To disable:
  1. Open SettingsWindow ManagerKeyboard
  2. Find Upper workspace and Bottom workspace
  3. Click Clear for both shortcuts

Debugging Keyboard Issues

If keybindings aren’t working:
  1. Debug keyboard events: Help → Debug Keyboard Events
  2. See what your terminal sends for each keypress
  3. Adjust keybindings or terminal configuration accordingly
See Troubleshooting: Debug Keyboard Events for details.

Next Steps

Settings Reference

Complete editor configuration options

Theme Configuration

Customize colors and themes