32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { isMac } from '../lib/platform.js'
|
|
|
|
const action = isMac ? 'Cmd' : 'Ctrl'
|
|
const paste = isMac ? 'Cmd' : 'Alt'
|
|
|
|
export const HOTKEYS: [string, string][] = [
|
|
...(
|
|
isMac
|
|
? ([
|
|
['Cmd+C', 'copy selection'],
|
|
['Ctrl+C', 'interrupt / clear draft / exit']
|
|
] as [string, string][])
|
|
: ([['Ctrl+C', 'copy selection / interrupt / clear draft / exit']] as [string, string][])
|
|
),
|
|
[action + '+D', 'exit'],
|
|
[action + '+G', 'open $EDITOR for prompt'],
|
|
[action + '+L', 'new session (clear)'],
|
|
[paste + '+V / /paste', 'paste clipboard image'],
|
|
['Tab', 'apply completion'],
|
|
['↑/↓', 'completions / queue edit / history'],
|
|
[action + '+A/E', 'home / end of line'],
|
|
[action + '+Z / ' + action + '+Y', 'undo / redo input edits'],
|
|
[action + '+W', 'delete word'],
|
|
[action + '+U/K', 'delete to start / end'],
|
|
[action + '+←/→', 'jump word'],
|
|
['Home/End', 'start / end of line'],
|
|
['Shift+Enter / Alt+Enter', 'insert newline'],
|
|
['\\+Enter', 'multi-line continuation (fallback)'],
|
|
['!cmd', 'run shell command'],
|
|
['{!cmd}', 'interpolate shell output inline']
|
|
]
|