Keybinding Maps
Fresh provides several built-in keybinding maps to match different editing styles:- Default
- Emacs
- VSCode
- macOS
- macOS GUI
Standard keybindings inspired by modern editors like VS Code:
Ctrl+P- Quick open (files, commands, buffers)Ctrl+S- Save fileCtrl+Z/Ctrl+Y- Undo / RedoCtrl+F- Find in file- Arrow keys for navigation
Shift+Arrowfor selection
Switching Keymaps
Change the active keymap in yourconfig.json:
config.json
"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.- Via menu: View → Keybinding Style → [Select keymap]
- Via command palette:
Ctrl+Pthen type>switch keybinding map
Custom Keybindings
Add custom keybindings to override the active keymap:config.json
Keybinding Structure
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Key name (e.g., "a", "Enter", "F1") |
modifiers | string[] | No | Modifier keys: "ctrl", "shift", "alt" |
action | string | Yes | Action to perform (e.g., "save", "move_left") |
args | object | No | Arguments for the action |
when | string | No | Context condition (e.g., "normal", "insert") |
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"
"ctrl", "shift", "alt"
Context Conditions
| Context | Description |
|---|---|
"global" | Active everywhere |
"normal" | Active in normal editing mode |
"insert" | Active in insert mode |
"file_explorer_focused" | Active when file explorer has focus |
"has_selection" | Active when text is selected |
"lsp_available" | Active when LSP is running for current buffer |
Example: Custom Keybindings
Chord Keybindings
Define multi-key sequences (like EmacsC-x C-s):
Custom Keymaps
Create your own named keymaps:config.json
Common Actions
Here are some frequently used actions for custom keybindings:File Operations
Navigation
Editing
Search
LSP
UI
Viewing Current Keybindings
To see all active keybindings:- Command palette:
Ctrl+P→>Show Keybindings - Menu: Help → Keyboard Shortcuts
- 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 Terminal Setup Guide
macOS Terminal Setup Guide
macOS Keymap
Fresh includes a dedicated macOS keymap that addresses terminal-specific challenges. To use it:Recommended Terminals
| Terminal | Support | Configuration |
|---|---|---|
| Kitty | Full | Add macos_option_as_alt left to config |
| Ghostty | Full | Add macos-option-as-alt = left to config |
| iTerm2 | CSI u | Enable “Report keys using CSI u” in Settings |
| Terminal.app | Manual | Import Fresh.terminal profile or configure manually |
iTerm2 Setup
- Go to Settings → Profiles → Keys
- Check Report keys using CSI u
- Set Left Option key to Esc+
- Set Right Option key to Normal (for special characters)
Terminal.app Setup
Import Profile (easiest):- Locate
scripts/macOS/Fresh.terminalin the repository - In Terminal.app, go to Settings → Profiles
- Click the gear icon and select Import…
- Select the
Fresh.terminalfile
- Settings → Profiles → Keyboard → Check Use Option as Meta key
- 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
- Shift+Up:
Mission Control Conflicts
macOS uses Ctrl+Arrow for desktop switching. To use Ctrl+Arrow in Fresh:- Open System Settings → Keyboard → Keyboard Shortcuts → Mission Control
- 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
| Option | Default | Description |
|---|---|---|
keyboard_disambiguate_escape_codes | true | Use CSI-u for unambiguous escape/modifier keys |
keyboard_report_event_types | false | Report key repeat and release events |
keyboard_report_alternate_keys | true | Send alternate keycodes |
keyboard_report_all_keys_as_escape_codes | false | Report all keys as escape sequences |
Linux: XFCE Window Manager
XFCE captures Ctrl+Alt+Up/Down for workspace switching. To disable:- Open Settings → Window Manager → Keyboard
- Find
Upper workspaceandBottom workspace - Click Clear for both shortcuts
Debugging Keyboard Issues
If keybindings aren’t working:- Debug keyboard events: Help → Debug Keyboard Events
- See what your terminal sends for each keypress
- Adjust keybindings or terminal configuration accordingly
Next Steps
Settings Reference
Complete editor configuration options
Theme Configuration
Customize colors and themes