在单个Visual Studio会话中打开文件的两个实例 [英] Open two instances of a file in a single Visual Studio session

查看:96
本文介绍了在单个Visual Studio会话中打开文件的两个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文件 xyz.cpp .我想在Visual Studio中打开此文件的两个实例(顺便说一句,我正在使用Visual Studio 2005).我为什么要这样做?我想并排比较同一文件的两个部分.我知道解决方法,例如:

I have a file, xyz.cpp. I want to open two instances of this file in Visual studio (BTW, I am using Visual Studio 2005). Why would I want to do so? I want to compare two sections of the same file side by side. I know workarounds such as:

  1. 复制文件.但是问题在于它并不优雅,而且我不想每次都遇到这种情况时就制作副本.

  1. Make a copy of the file. But the problem is that it's not elegant, and I don't want to make copies every time I am faced with this.

我可以将窗口分为两部分.我只能将其水平拆分的拆分问题.水平分割的结果是屏幕的右半部分是空白.

I can split the window into two. The problem with split it that I can split it horizontally only. The result of a horizontal split is that the right half of my screen is white space.

如果能够垂直拆分它或打开同一文件的两个实例,则会增加我可以比较的代码行数.

If I were able to split it vertically or open two instances of the same file, it would increase the number of lines of code I can compare.

推荐答案

这是操作方法...

  1. 选择您想要两个副本的标签
  2. 从菜单中选择菜单窗口新窗口.
  3. 右键单击新标签,然后选择新垂直标签组
  1. Select the tab you want two copies of
  2. Select menu WindowNew Window from the menu.
  3. Right click the new tab and select New Vertical Tab Group

如果* Window菜单中未列出 New Window ,请注意该命令确实存在,即使从Visual Studio 2017起也是如此.使用菜单工具自定义命令,将其添加到 Window 菜单中.此时,决定将 New Window 命令放在何处,然后选择 Add Command .

If New Window is not listed in the *Window menu note that the command does exist, even as of Visual Studio 2017. Add it to the Window menu using menu ToolsCustomizeCommands. At that point decide where to put the New Window command and select Add Command.

更新于"2018年7月30日"

UPDATED on "30 July 2018"

在Visual Studio Code版本1.25.1和更高版本中

In Visual Studio Code version 1.25.1 and later

方法1

您可以在侧面板(资源管理器)中简单地左键单击文件,然后按 Ctrl + Enter .

You can simple left click on your file in the side-panel (explorer) and press Ctrl + Enter.

方法2

只需右键单击Visual Studio Code侧面板(浏览器)中的文件,然后选择第一个选项向侧面打开.

Simply right click on your file in the Visual Studio Code side-panel (explorer) and select the first option open to the side.

这篇关于在单个Visual Studio会话中打开文件的两个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆