在VS代码中以左或右编辑组打开文件
是否有一种方法可以始终在特定代码编辑器组中(例如左或最右键组)中在VS Code的文件资源管理器中选择的文件?
我可以使用“向侧面打开”(ctrl-enter)在右侧打开一个新组中的文件。否则,当前活动组中的文件(在预览或其他方式)打开。这可能很烦人,因为我经常在活动组中的文件上工作,并且想参考我已经打开的侧组中的另一个文件(其中还有另一个文件),而不是新的侧面组。我必须先激活侧组,然后打开我想看的文件:但是我通常会忘记哪个组活动处于活动状态,然后打开我想看的文件代替我正在编辑的文件...
我可以在打开文件之前,请使用CTRL-1,CTRL-2等在组之前切换到组:但是我宁愿将文件资源管理器用作GUI来探索文件,而无需考虑:如果我可以“固定”该文件文件资源管理器到给定编辑器组,这将更简单。
Is there a means to always open files chosen in VS Code's file explorer in a particular code editor group, say the left or right-most group?
I can use "Open to the side" (Ctrl-Enter) to open a file in a new group, to the right. Otherwise a file opens (in preview or otherwise) in the currently active group. This can be annoying, because often I'm working on a file in the active group, and want to refer to another file in a side group which I already have open (with another file in it), rather than a new side group. I have to activate the side group first, and then open the file I want to see: but I usually forget which group is active, and open the file I want to look at in place of the one I was editing...
I can use Ctrl-1, Ctrl-2 etc to switch to a group before opening a file: but I'd rather be able to use the file explorer as a GUI to explore files, without having to think: if I could "pin" the file explorer to a given editor group, it would be simpler.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以做的是锁定参考文件所在的组(例如在右侧),然后单击该组中的三个点,然后单击 lock group ,如图所示:
这将确保该组中没有打开新文件,而是在其他组中打开,左侧。
What you can do is lock the group where your reference file is - for example on the right side - by clicking on the three dots within that group and then clicking Lock group, as shown:
This will make sure that no new files are opened in that group, but instead will be opened in your other group, on the left side.
目前是不可能的。但是我认为您可以尝试使用两种解决方法:
始终关闭您不需要的编辑组/编辑器组,因此您在打开
时只能打开一个编辑器
。要默认关闭当前编辑器,它是ctrl+f4
,并且要关闭整个编辑器组,没有默认快捷方式,因此您必须在键盘快捷键
tab中自己添加它。 /p>一次将打开的编辑器的数量限制为仅2,因此向侧面打开将替换较旧的编辑器(不是上次活跃的一个)。为此,您必须修改以下两个设置:
还可以为此创建自定义快捷方式(检查是否有多个编辑器组
多个editorgroups
,如果这样关闭,则只需打开打开),以下是示例如何创建一个Currently it is not possible. But i think there are two workarounds you could try to use:
Always close editor/editor group that you don't need so you would have only one editor open at the time of opening
to side
. To close current editor by default it isCTRL+F4
and to close whole editor group there is no default shortcut so you would have to add it yourself inKeyboard Shortcuts
tab.Limit the number of opened editors at one time to just 2, so opening to the side will replace older editor (not the one that was active last time). To do that you have to modify this two following settings:
Or you can just drag and drop with your mouse the file to the editor you want ;P
EDIT:
It would also be possible to create custom shortcut for that (checks if there are multiple editor groups
multipleEditorGroups
and if so closes them and then just call open to side), here is example how to create one锁定小组是一个很好的建议,但是您需要记住在VSCODE上打开的每个项目。我使用的替代快速快捷方式是
移动组之间的打开文件。您可以从

首选项更改绑定:打开键盘快捷键
,如下所示:Locking the group is a great suggestion but you need to remember to do that for every project you open on VSCode. An alternative quick shortcut I use is
to move the opened file between groups. You can change the binding from

Preferences: Open Keyboard Shortcuts
as shown here: