在Visual Studio Code中在编辑器和集成终端之间切换焦点

Switch focus between editor and integrated terminal in Visual Studio Code

有谁知道键盘快捷键(Mac和Linux)可以在Visual Studio Code中在编辑器和集成终端之间切换焦点?


尽管有很多用于VS Code的模式切换和导航快捷键,但没有一个专门用于"从编辑器移至终端,然后再次返回"的。但是,可以通过重载key并使用when子句来组成两个步骤。

从编辑器中打开keybindings.json:CMD-SHIFT-P->首选项:打开键盘快捷方式文件并添加以下条目:

1
2
3
// Toggle between terminal and editor focus
{"key":"ctrl+`","command":"workbench.action.terminal.focus"},
{"key":"ctrl+`","command":"workbench.action.focusActiveEditorGroup","when":"terminalFocus"}

通过这些快捷方式,我将使用相同的按键在编辑器和集成终端之间集中精力。


ctrl + `:专注于集成终端

ctrl + 1:专注于编辑器(如果editor-2命令为ctrl + 2)

enter image description here

更多信息:http://www.rscoder.com/2020/04/how-to-switch-focus-between-editor-and.html

  • 到底在哪里?
  • 在ESC键正下方:)
  • 谢谢。我需要Ctrl + 1,因为在某些情况下,ctrl +将打开外部终端,无法再次使用该终端返回VSCode编辑器
  • 最简单,最准确的答案恕我直言。
  • Control +诹秸咧淝谢弧N掖酉嗟背さ囊欢问奔淇际褂谩