如何将 Visual Studio 代码中的面板移动到右侧?

How do I move the panel in Visual Studio Code to the right side?

默认在底部。

例如,在下图中,面板(D 部分)位于底部,我希望它移动到右侧,即 README.md editor 在编辑器组(C 部分)中显示的区域).

图片来源:(https://code.visualstudio.com/images/codebasics_hero.png

我不知道它是从哪个版本开始改变的,但 1.11.2 在“视图”选项卡中有一个选项,可以将左侧栏向右侧更改,反之亦然

对于寻找答案(关于如何移动侧面板)的人:

你可以按

ctrl + ,(或 OSX 上的 cmd + ,

并将以下选项添加到您的用户设置 JSON 文件中:

"workbench.sideBar.location": "right"

你也可以在内部版本中做同样的事情,右上角有一个选项可以切换到侧边栏面板https://code.visualstudio.com/insiders/

终端在底部

终端在右边

单击菜单选项 View > Appearance > Move to Side Bar Right。一旦侧边栏向右移动,选项“向右移动侧边栏”将更改为“向左移动侧边栏”。

我在 Mac 上使用 Visual Studio 代码 v1.24.0。

默认情况下,Panel会出现在底部(您也可以更改默认值,请参考@Forres的回答:

这是 VS 代码面板的 bottom/right 切换按钮:

单击此按钮后,面板会向右移动。

不过将其移回有点棘手。如您所见,一些按钮是隐藏的。这是因为右对齐时面板的宽度太小了。我们需要展开列以查看所有按钮。

扩展后的样子:

现在,如果您想将面板移回底部,请再次单击切换 bottom/top 按钮。

单击菜单选项 View > Appearance > Move Side Bar Right 或 settings.json:

"workbench.panel.defaultLocation": "right"

自 2018 年 10 月(版本 1.29)起,@mvvijesh 的回答中的按钮不再存在。

您现在有 2 个选择。 右键单击面板的工具栏(面板上的其他任何地方都不起作用)并选择 "move panel right/bottom":

或从命令面板中选择“视图:切换面板位置”。

来源:VSCode 更新说明:https://code.visualstudio.com/updates/v1_29#_panel-position-button-to-context-menu

希望这会对某人有所帮助。

-> 打开键盘快捷键

-> 搜索 "workbench.action.togglePanelPosition"

-> 指定您想要的快捷方式

我已经分配了键绑定"cmd+`"

{
  "key": "cmd+`",
  "command": "workbench.action.togglePanelPosition"
}

现在我可以通过按 "cmd + `"

来切换终端

对于 Visual Studio 代码 v1.31.1,您可以通过 View 菜单切换面板会话。

  • 转到查看菜单。
  • 通过外观选项,点击Toggle Panel Position

截至 2019 年 6 月,可以通过搜索找到此设置 'Panel' - 如果您想更改默认设置,有一个选项,如屏幕截图所示:

VSCode 1.42(2020 年 1 月)介绍:

Panel on the left/right

The panel can now be moved to the left side of the editor with the setting:

"workbench.panel.defaultLocation": "left"

This removes the command View: Toggle Panel Position (workbench.action.togglePanelPosition) in favor of the following new commands:

  • View: Move Panel Left (workbench.action.positionPanelLeft)
  • View: Move Panel Right (workbench.action.positionPanelRight)
  • View: Move Panel To Bottom (workbench.action.positionPanelBottom)
"workbench.panel.defaultLocation": "right",

"Wokbench.panel.defaultLocation": "right"

使用 CTRL+. 打开设置,搜索 terminal,您应该会在顶部看到此设置。从设置说明下方的下拉列表中,选择 right。请参阅下面的屏幕截图。

前往 view,然后前往 appearence。然后select移动面板底部。

作为 GUI 中的示例。查看->外观->向右移动边栏

在版本 1.55.2 中。

转到查看 --> 外观 --> 向右移动面板

从左下角的滚轮图标转到命令面板 --> 搜索并进入“设置”菜单 --> 在搜索栏中搜索“面板” --> Select 默认位置为“右”而不是“底部”。 重新加载 VS Code,一切顺利。

在 v1.64.2 中,他们恢复了命令 View: Move Panel Right (or Left)。您可以将面板(通常在其中包含 Terminal/Output/etc.)作为左侧或右侧的垂直列 - 如果您愿意,可以放在边栏或侧面板旁边。


他们正在修复 v1.64 带来的变化,应该在 Insiders v1.65 02/08/2022 中。

只需使用命令面板中的 View: Move Panel Right/Left/Bottom 命令。


[过时的答案,见上文。]

从稳定版 v1.64 开始,设置 "Wokbench.panel.defaultLocation": "right" 将不再有效。

Replacing Panel Location

As mentioned above, the new Side Panel provides similar functionality as moving the Panel to the left or right, yet improves on this by not forcing the move of the original panel. Along with view drag and drop between panels, the new Side Panel is replacing the option to move the bottom Panel.

In light of that, we have deprecated the workbench.panel.defaultLocation setting as well as the Move Panel... commands in favor of similar commands Move Views From Panel To Side Panel (workbench.action.movePanelToSidePanel) and Move Views From Side Panel To Panel (workbench.action.moveSidePanelToPanel). The old commands will remap to the appropriate new command providing the similiar behavior. Though, we recommend updating your keybindings to the new commands.

这有利于使用新的 Side Panel,它可以补充以前的 Side Bar(Explorer、SCM 视图传统上所在的位置)和面板(其中 Terminal、Output等传统上是)。因此,您可以获得 3 panel-types 的观看次数。在 v1.64 发行说明中查看更多信息:https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_64.md#new-side-panel

默认情况下,⌘J 切换(底部)面板。如果您的所有视图都在侧面板上,请通过以下操作 ⌘J 切换侧面板:

代码>首选项>键盘快捷键>“Command+J”>Right-click>删除键绑定

代码 > 首选项 > 键盘快捷键 > 查看:切换侧面板 > 添加键绑定 > ⌘J

面板默认在右侧打开。

请注意,此设置需要在新文件夹中才能生效。

如果VSCode之前打开过该文件夹,面板仍将使用旧位置。

"workbench.panel.defaultLocation": "right",

此答案适用于那些只希望 终端 在右侧(如上所示)而不关心面板的人。

  1. 使用键盘快捷键 command + shift + pctrl + shift + p
  2. 显示 vscode 的命令面板
  3. 输入“终端编辑器”
  4. 选择 Terminal: Create New Terminal in Editor Area to the Side
  5. 选项