feat: add shortcut for Copy Content

This commit is contained in:
purocean
2022-03-14 17:06:22 +08:00
parent e705a3c619
commit c51ee8f176
2 changed files with 17 additions and 2 deletions
+5
View File
@@ -1,5 +1,8 @@
---
enableMacro: true
define:
'Ctrl/Cmd': '[= $ctx.env.isMacOS ? "Cmd" : "Ctrl" =]'
'Alt/Option': '[= $ctx.env.isMacOS ? "Option" : "Alt" =]'
---
## Shortcuts
@@ -48,6 +51,7 @@ Toggle Word Wrap | Alt/Option + W
Toggle Preview | Alt/Option + V
Toggle Terminal | Alt/Option + T
Toggle Control Center | Alt/Option + C
Show Copy Content Panel | Ctrl/Cmd + Shift + C
Presentation | F5
Zoom In | Ctrl/Cmd + =
Zoom Out | Ctrl/Cmd + -
@@ -96,6 +100,7 @@ Zoom Reset | Ctrl/Cmd + 0
切换文档预览显示 | Alt/Option + V
切换终端 | Alt/Option + T
切换控制中心 | Alt/Option + C
展示复制面板 | Ctrl/Cmd + Shift + C
演示模式 | F5
缩放放大 | Ctrl/Cmd + =
缩放缩小 | Ctrl/Cmd + -
+12 -2
View File
@@ -123,13 +123,23 @@ export default {
}
}
const id = 'plugin.copy-content.copy-content'
ctx.action.registerAction({
name: id,
handler: copyContent,
keys: [ctx.command.CtrlCmd, ctx.command.Shift, 'c'],
})
ctx.statusBar.tapMenus(menus => {
menus['status-bar-tool']?.list?.push(
{
id: 'plugin.copy-content.copy-content',
id,
type: 'normal',
title: ctx.i18n.t('status-bar.tool.copy-content'),
onClick: () => copyContent()
subTitle: ctx.command.getKeysLabel(id),
onClick: () => copyContent(),
order: 100,
},
)
})