Skip to content

Commit 370a91e

Browse files
committed
feat: map esc to cancel
1 parent c7a2652 commit 370a91e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/core/src/utils/settings.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ interface InternalClackSettings {
1010
export const settings: InternalClackSettings = {
1111
actions: new Set(actions),
1212
aliases: new Map<string, Action>([
13+
// vim support
1314
['k', 'up'],
1415
['j', 'down'],
1516
['h', 'left'],
1617
['l', 'right'],
1718
['\x03', 'cancel'],
19+
// opinionated defaults!
20+
['escape', 'cancel'],
1821
]),
1922
};
2023

@@ -24,7 +27,7 @@ export interface ClackSettings {
2427
* This will not overwrite existing aliases, it will only add new ones!
2528
*
2629
* @param aliases - An object that maps aliases to actions
27-
* @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel' }
30+
* @default { k: 'up', j: 'down', h: 'left', l: 'right', '\x03': 'cancel', 'escape': 'cancel' }
2831
*/
2932
aliases: Record<string, Action>;
3033
}

0 commit comments

Comments
 (0)