在Visual Studio类似于Eclipse的Alt键 + ↑/↓一个按键?Visual Studio的击键:有交换线
例如:
int x = 0; // Cursor is anywhere on this line.
int y = 1;
和Alt键 + 向下被按下,则:
int y = 1;
int x = 0; // Cursor is anywhere on this line.
在Visual Studio类似于Eclipse的Alt键 + ↑/↓一个按键?Visual Studio的击键:有交换线
例如:
int x = 0; // Cursor is anywhere on this line.
int y = 1;
和Alt键 + 向下被按下,则:
int y = 1;
int x = 0; // Cursor is anywhere on this line.
VS 2013和更高版本:
Alt键 + ↑(Edit.MoveSelectedLinesUp
)
Alt键 + ↓(Edit.MoveSelectedLinesDown
)
VS 2012:
移 + Alt键 + Ť (Edit.LineTranspose
)
但当前和下一行之间的这种只互换(仅向下移动)。
VS 2012不支持宏,但存在Productivity Power Tools 2012扩展,增加了(除了其他一些不错的功能)命令与Alt键 + ↑和Alt键 + ↓向上或向下移动一行。
VS 2010和更早的版本:
线调换作品(移 + Alt键+Ť),但仍然没有拉升。
你可以写这些命令的宏,我认为这个问题可以帮助你:Visual Studio: hotkeys to move line up/down and move through recent changes
作为替代解决方案,你可以写一个Visual Studio扩展为做到这一点您。扩展名是用您最喜欢的.NET语言编写的。
有关更多信息,请参阅有关创建Visual Studio Extensions的MSDN文章。
由于Visual Studio的2013年,你可以简单地使用Alt键 + ↑/↓
alt + Up/Down在Visual Studio 2017中仍然有效,+1 – Pac0 2017-04-10 15:01:33