如何在新标签页中打开文件?
如何使用 Ctrl+P 打开新文件,使其不会覆盖当前文件,而是使用新标签页?
How do I open a new file using Ctrl+P, so it doesn't override the current file, but rather use a new tab?
另外,如果搜索的文件已经在选项卡上打开,是否可以将其聚焦而不是打开它,以避免重复?
Also, would it be possible to focus the searched file instead of opening it, if it was already opened on a tab, to avoid duplicates?
当单击侧边栏中的文件时,Visual Studio Code 会在预览模式下打开它,这允许您快速查看文件.
When a single click to a file is made in the sidebar, Visual Studio Code opens it in Preview Mode, which allows you to quickly view files.
- 预览模式中的选项卡不会保持打开状态.
- 只要您从侧边栏中打开另一个文件,它就会覆盖处于预览模式的现有文件.
- 如果处于预览模式,选项卡的标题将为斜体,如下面的屏幕截图.
如果您想编辑文件,请不要在预览模式下打开,而是双击侧栏中的文件.
Important!
If you want to edit a file, don't open in Preview Mode, double-click on the file in the sidebar instead.
如果文件已在预览模式下打开,则将其转换为编辑模式:
If the file is already open in Preview mode, then to convert it to edit mode:
- 双击标题栏中的斜体文件名,或
- 按Ctrl-K 回车
标准:
如果你想同时禁用预览模式,那就是:
If you want to disable Preview Mode all together, that is:
- 通过侧边菜单访问文件.
- 使用 Ctrl + P 打开快速打开菜单.
- accessing file through side-menu.
- opening quick open menu using Ctrl + P.
解决方案:
- 使用快捷键 Ctrl命令面板/kbd>+Shift+P.
- 输入
首选项:打开用户设置
.这将打开设置编辑器.搜索workbench.editor.enablePreview
,然后取消选中复选框(更改会自动保存并用蓝色左边框指示).
- Open the Command Palette using the shortcut Ctrl+Shift+P.
- Type
Preferences: Open User Settings
. This will open the Settings editor. Search forworkbench.editor.enablePreview
, and uncheck the checkbox (changes are autosaved and indicated with a blue left border).
附加:
- 如果您只想在快速打开菜单中禁用预览模式,请取消选中
workbench.editor.enablePreviewFromQuickOpen
的复选框.
- If you only want to disable preview mode in the quick open menu, uncheck the box for
workbench.editor.enablePreviewFromQuickOpen
.