mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Add shell alias commands (#2426)
This commit is contained in:
parent
dcccd11a29
commit
97308bd8e5
6 changed files with 150 additions and 1 deletions
|
|
@ -62,6 +62,30 @@ const commands = {
|
|||
},
|
||||
'pane:next': focusedWindow => {
|
||||
focusedWindow.rpc.emit('next pane req');
|
||||
},
|
||||
'editor:movePreviousWord': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session move word left req');
|
||||
},
|
||||
'editor:moveNextWord': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session move word right req');
|
||||
},
|
||||
'editor:moveBeginningLine': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session move line beginning req');
|
||||
},
|
||||
'editor:moveEndLine': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session move line end req');
|
||||
},
|
||||
'editor:deletePreviousWord': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session del word left req');
|
||||
},
|
||||
'editor:deleteNextWord': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session del word right req');
|
||||
},
|
||||
'editor:deleteBeginningLine': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session del line beginning req');
|
||||
},
|
||||
'editor:deleteEndLine': focusedWindow => {
|
||||
focusedWindow.rpc.emit('session del line end req');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,14 @@
|
|||
"editor:copy": "command+c",
|
||||
"editor:paste": "command+v",
|
||||
"editor:selectAll": "command+a",
|
||||
"editor:movePreviousWord": "alt+left",
|
||||
"editor:moveNextWord": "alt+right",
|
||||
"editor:moveBeginningLine": "command+left",
|
||||
"editor:moveEndLine": "command+right",
|
||||
"editor:deletePreviousWord": "alt+backspace",
|
||||
"editor:deleteNextWord": "alt+delete",
|
||||
"editor:deleteBeginningLine": "command+backspace",
|
||||
"editor:deleteEndLine": "command+delete",
|
||||
"editor:clearBuffer": "command+k",
|
||||
"editor:emojis": "command+ctrl+space",
|
||||
"plugins:update": "command+shift+u"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,14 @@
|
|||
"editor:copy": "ctrl+shift+c",
|
||||
"editor:paste": "ctrl+shift+v",
|
||||
"editor:selectAll": "ctrl+shift+a",
|
||||
"editor:movePreviousWord": "ctrl+left",
|
||||
"editor:moveNextWord": "ctrl+right",
|
||||
"editor:moveBeginningLine": "home",
|
||||
"editor:moveEndLine": "end",
|
||||
"editor:deletePreviousWord": "ctrl+backspace",
|
||||
"editor:deleteNextWord": "cltr+del",
|
||||
"editor:deleteBeginningLine": "ctrl+home",
|
||||
"editor:deleteEndLine": "ctrl+end",
|
||||
"editor:clearBuffer": "ctrl+shift+k",
|
||||
"plugins:update": "ctrl+shift+u"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
"zoom:in": "ctrl+plus",
|
||||
"zoom:out": "ctrl+minus",
|
||||
"window:new": "ctrl+shift+n",
|
||||
"window:minimize": "ctrl+m",
|
||||
"window:minimize": "ctrl+shift+m",
|
||||
"window:zoom": "ctrl+shift+alt+m",
|
||||
"window:toggleFullScreen": "f11",
|
||||
"window:close": "ctrl+shift+q",
|
||||
|
|
@ -26,6 +26,14 @@
|
|||
"editor:copy": "ctrl+shift+c",
|
||||
"editor:paste": "ctrl+shift+v",
|
||||
"editor:selectAll": "ctrl+shift+a",
|
||||
"editor:movePreviousWord": "ctrl+left",
|
||||
"editor:moveNextWord": "ctrl+right",
|
||||
"editor:moveBeginningLine": "home",
|
||||
"editor:moveEndLine": "end",
|
||||
"editor:deletePreviousWord": "ctrl+backspace",
|
||||
"editor:deleteNextWord": "cltr+del",
|
||||
"editor:deleteBeginningLine": "ctrl+home",
|
||||
"editor:deleteEndLine": "ctrl+end",
|
||||
"editor:clearBuffer": "ctrl+shift+k",
|
||||
"plugins:update": "ctrl+shift+u"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,75 @@ module.exports = (commandKeys, execCommand) => {
|
|||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Move to...',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Previous word',
|
||||
accelerator: commandKeys['editor:movePreviousWord'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:movePreviousWord', focusedWindow);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Next word',
|
||||
accelerator: commandKeys['editor:moveNextWord'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:moveNextWord', focusedWindow);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Line beginning',
|
||||
accelerator: commandKeys['editor:moveBeginningLine'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:moveBeginningLine', focusedWindow);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Line end',
|
||||
accelerator: commandKeys['editor:moveEndLine'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:moveEndLine', focusedWindow);
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Delete...',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Previous word',
|
||||
accelerator: commandKeys['editor:deletePreviousWord'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:deletePreviousWord', focusedWindow);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Next word',
|
||||
accelerator: commandKeys['editor:deleteNextWord'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:deleteNextWord', focusedWindow);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Line beginning',
|
||||
accelerator: commandKeys['editor:deleteBeginningLine'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:deleteBeginningLine', focusedWindow);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Line end',
|
||||
accelerator: commandKeys['editor:deleteEndLine'],
|
||||
click(item, focusedWindow) {
|
||||
execCommand('editor:deleteEndLine', focusedWindow);
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
label: 'Clear Buffer',
|
||||
accelerator: commandKeys['editor:clearBuffer'],
|
||||
|
|
|
|||
32
lib/index.js
32
lib/index.js
|
|
@ -67,6 +67,38 @@ rpc.on('session clear req', () => {
|
|||
store_.dispatch(sessionActions.clearActiveSession());
|
||||
});
|
||||
|
||||
rpc.on('session move word left req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x1bb'));
|
||||
});
|
||||
|
||||
rpc.on('session move word right req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x1bf'));
|
||||
});
|
||||
|
||||
rpc.on('session move line beginning req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x1bOH'));
|
||||
});
|
||||
|
||||
rpc.on('session move line end req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x1bOF'));
|
||||
});
|
||||
|
||||
rpc.on('session del word left req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x1b\x7f'));
|
||||
});
|
||||
|
||||
rpc.on('session del word right req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x1bd'));
|
||||
});
|
||||
|
||||
rpc.on('session del line beginning req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x1bw'));
|
||||
});
|
||||
|
||||
rpc.on('session del line end req', () => {
|
||||
store_.dispatch(sessionActions.sendSessionData(null, '\x10B'));
|
||||
});
|
||||
|
||||
rpc.on('termgroup add req', () => {
|
||||
store_.dispatch(termGroupActions.requestTermGroup());
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue