visual-studio-code - VSCode shorcut to tab between files on secondary editor group
问题描述
I'm currently using VSCode to edit latex documents. The setup I have is the latex document in one editor group to the left, and then the preview of the document (pdf) in another group to the right. Additionally, I keep some other files open in the right work group as well.
Is there a way to make a shortcut, which tabs through the files in right work group, while the focus remains on the left one?
解决方案
我认为没有任何内置方法可以做到这一点。您可以很容易地使用宏来完成它。使用像multi-command这样的宏扩展将其放入您的设置中:
"multiCommand.commands": [
{
"command": "multiCommand.NextEditorOtherGroup",
"sequence": [
"workbench.action.focusNextGroup",
"workbench.action.nextEditorInGroup",
"workbench.action.focusNextGroup"
// "workbench.action.focusPreviousGroup" if you more than two editor groups for example
]
},
{
"command": "multiCommand.PreviousEditorOtherGroup",
"sequence": [
"workbench.action.focusNextGroup",
"workbench.action.previousEditorInGroup",
"workbench.action.focusNextGroup"
]
}
]
宏只关注另一个编辑器组(它假设你只有两个,如果你有更多宏可以修改以关注right/last/most recently used
编辑器组。在关注另一个编辑器组之后,它移动到另一个编辑器中的下一个/上一个编辑器组,然后将焦点返回到另一个组(因为您只有两个编辑器组focusNextGroup
在这里工作得很好,如果您有更多并且想要返回到以前集中的组使用workbench.action.focusPreviousGroup
)。
然后是您想用来触发这些宏的任何键绑定(在 keybindings.json 中):
{
"key": "alt+q", // trigger the macro with any keybinding you wish
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.NextEditorOtherGroup" },
"when": "editorTextFocus"
},
{
"key": "shift+alt+q", // any keybinding
"command": "extension.multiCommand.execute",
"args": { "command": "multiCommand.PreviousEditorOtherGroup" },
"when": "editorTextFocus"
},
推荐阅读
- amazon-web-services - 设置一个 aws 帐户拥有的 s3 对另一个 aws 帐户拥有的 firehose 流的写入访问权限
- c - 何时为 OpenMP 使用私有和共享变量
- javascript - 在获得角度 5 的结果后,如何确保 typescript 接口属性为大写?
- tensorflow - 有什么方法可以创建点对点 TensorFlow 环境?
- post - 没有 FormUrlEncodedContent 的 HttpClient Post
- java - 如何在java线程中实现检查连接是否存在?
- java - 使用 Firebase for android 发送电子邮件验证时未选中的分配警告
- java - Spring 数据存储库不检查标记为在主实体下级联的类上的 isNew(entity)
- java - 片段中 RecyclerView 中的 textView 不显示来自 Java 或 XML 文件的任何文本
- r - sparklyr 中 R 的 list() 函数的等价物是什么?