Skip to content

Commit

Permalink
feat: add shortcut for Copy Content
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Mar 14, 2022
1 parent e705a3c commit c51ee8f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions help/SHORTCUTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
enableMacro: true
define:
'Ctrl/Cmd': '[= $ctx.env.isMacOS ? "Cmd" : "Ctrl" =]'
'Alt/Option': '[= $ctx.env.isMacOS ? "Option" : "Alt" =]'
---

## Shortcuts
Expand Down Expand Up @@ -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 + -
Expand Down Expand Up @@ -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 + -
Expand Down
14 changes: 12 additions & 2 deletions src/renderer/plugins/copy-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
})
Expand Down

0 comments on commit c51ee8f

Please sign in to comment.