mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 03:04:28 +00:00
feat: configurable keybindings for all editor and app actions
All keybindings configurable via ~/.pi/agent/keybindings.json
Editor actions:
- cursorUp, cursorDown, cursorLeft, cursorRight
- cursorWordLeft, cursorWordRight, cursorLineStart, cursorLineEnd
- deleteCharBackward, deleteCharForward, deleteWordBackward
- deleteToLineStart, deleteToLineEnd
- newLine, submit, tab
- selectUp, selectDown, selectConfirm, selectCancel
App actions:
- interrupt, clear, exit, suspend
- cycleThinkingLevel, cycleModelForward, cycleModelBackward
- selectModel, expandTools, toggleThinking, externalEditor
Also adds support for numpad Enter key (Kitty protocol codepoint 57414
and SS3 M sequence)
Example emacs-style keybindings.json:
{
"cursorUp": ["up", "ctrl+p"],
"cursorDown": ["down", "ctrl+n"],
"cursorLeft": ["left", "ctrl+b"],
"cursorRight": ["right", "ctrl+f"],
"deleteCharForward": ["delete", "ctrl+d"],
"cycleModelForward": "ctrl+o"
}
This commit is contained in:
parent
5f91baa29e
commit
8f2682578b
23 changed files with 949 additions and 1048 deletions
|
|
@ -20,45 +20,18 @@ export { type SettingItem, SettingsList, type SettingsListTheme } from "./compon
|
|||
export { Spacer } from "./components/spacer.js";
|
||||
export { Text } from "./components/text.js";
|
||||
export { TruncatedText } from "./components/truncated-text.js";
|
||||
// Kitty keyboard protocol helpers
|
||||
// Keybindings
|
||||
export {
|
||||
isAltBackspace,
|
||||
isAltEnter,
|
||||
isAltLeft,
|
||||
isAltRight,
|
||||
isArrowDown,
|
||||
isArrowLeft,
|
||||
isArrowRight,
|
||||
isArrowUp,
|
||||
isBackspace,
|
||||
isCtrlA,
|
||||
isCtrlC,
|
||||
isCtrlD,
|
||||
isCtrlE,
|
||||
isCtrlG,
|
||||
isCtrlK,
|
||||
isCtrlL,
|
||||
isCtrlLeft,
|
||||
isCtrlO,
|
||||
isCtrlP,
|
||||
isCtrlRight,
|
||||
isCtrlT,
|
||||
isCtrlU,
|
||||
isCtrlW,
|
||||
isCtrlZ,
|
||||
isDelete,
|
||||
isEnd,
|
||||
isEnter,
|
||||
isEscape,
|
||||
isHome,
|
||||
isShiftCtrlD,
|
||||
isShiftCtrlO,
|
||||
isShiftCtrlP,
|
||||
isShiftEnter,
|
||||
isShiftTab,
|
||||
isTab,
|
||||
Keys,
|
||||
} from "./keys.js";
|
||||
DEFAULT_EDITOR_KEYBINDINGS,
|
||||
type EditorAction,
|
||||
type EditorKeybindingsConfig,
|
||||
EditorKeybindingsManager,
|
||||
getEditorKeybindings,
|
||||
type KeyId,
|
||||
setEditorKeybindings,
|
||||
} from "./keybindings.js";
|
||||
// Keyboard input handling
|
||||
export { matchesKey, parseKey } from "./keys.js";
|
||||
// Terminal interface and implementations
|
||||
export { ProcessTerminal, type Terminal } from "./terminal.js";
|
||||
// Terminal image support
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue