With Visual Studio, Open Same File In Two Windows, Updates Reflected in Both

本文介绍了一个Visual Studio的强大但不那么显眼的功能:如何在同一会话中打开同一个文件的两个实例以便于同时查看和编辑文件的不同部分。通过使用“窗口/新建窗口”功能,可以轻松实现这一目标,并且更改在一个窗口中进行时会实时反映到另一个窗口中。

I’ve always been frustrated in Visual Studio (all versions I can remember including latest vs2012) with not being able to look at the top of a file and edit the bottom.  Recently, on an Microsoft insiders list I participate in, someone posted that exact feature as a suggestion for future versions of Visual Studio.  Before I had a chance to post back a “+1” some one else posted back that you’ve been able to do that for years in all the versions of Visual Studio he could remember.

All you have to do is, with the version of the file you want to duplicate open (you are selected to that tab), press the menu choice “Window/New Window” and presto!  you have two copies.

image

Now, after pressing Window/New Window you get:

image

And, if you do the nice “multi monitor” support in Visual Studio by dragging one off of Visual Studio on to your desktop, you now can see and edit two copies of the same files.  Changes in one are immediately updated in the other.  Just what I’ve always wanted!!!

image

Not so discoverable, but an awesome feature.  Maybe it would be nice, as someone else suggested, to have that in the drop down of the file’s tab and it would be easier to find.

Hope this helps!

http://peterkellner.net/2012/07/08/with-visual-studio-open-same-file-in-two-windows-updates-reflected-in-both/

可惜的是,直到 2013,VS 并不是对所有的文件类型都支持双窗口,于是你需要下面的方案。不过,经过实验,对于13有用,对于12则会出现虽然打开了第二个窗口,但是窗口中内容为空。

http://stackoverflow.com/questions/728949/open-two-instances-of-a-file-in-single-visual-studio-session

不过上面的链接操作起来有实际困难,实际你只需要查询注册表中的“Single Code Window Only”,然后全部改为值为0就可以了。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值