Move line Up/Down shortcut in Visual Studio 2012

后端 未结 9 1679
广开言路
广开言路 2021-01-30 15:59

In VS2010 I had a shortcut set up Alt+Up/Down to move lines of code up or down, just like I used to have in Eclipse in my Java days.

Now since Powe

9条回答
  •  滥情空心
    2021-01-30 16:10

    Install ReSharper.

    Open Tools -> Options -> Environment -> Keyboard (as shown in a picture)

    1. Find "ReSharper.ReSharper_MoveUp"
    2. In "Use new shortcut in:" choose: "Text Editor"
    3. Click in "Press shortcut keys:" and press your shortcut (for example Alt+ArrowUp)
    4. Press "Assign" button Same with with "ReSharper.ReSharper_MoveDown"

    P.S. Works fine for single lines and multiple selected lines, but removes selection after moved 1 line. Hope there are way to move multiple lines multiple times in one selection.

提交回复
热议问题