Is there a keystroke in visual studio similar to Eclipse's Alt + ↑/↓?
For example:
int x = 0; // Cursor is anywhere on this line. int y = 1;
and Alt + Down were pressed, then:
int y = 1; int x = 0; // Cursor is anywhere on this line.
Edit.SelectionCancel. Surround with. Ctrl+K, Ctrl+S. (available only in Visual Studio 2019 and earlier)
Click File > Preferences > Keyboard Shortcuts. There is a triple-dot (...) at the top-right hand corner. Click on that and select "Show User Keybindings" Delete your listed keybindings.
Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.
VS 2013 and later:
Alt + ↑ (Edit.MoveSelectedLinesUp
)
Alt + ↓ (Edit.MoveSelectedLinesDown
)
VS 2012:
Shift+Alt+ T (Edit.LineTranspose
)
but this only swaps between the current and the next line (move down only).
VS 2012 does not support macros but there is the Productivity Power Tools 2012 extension that adds (besides some other nice features) commands to move a line up or down with Alt + ↑ and Alt + ↓.
VS 2010 and earlier:
Line transpose works (Shift+Alt+ T) but still no move up.
You could write a macro for those commands, I think this question may help you: Visual Studio: hotkeys to move line up/down and move through recent changes
As of Visual Studio 2013, you can simply use Alt + ↑ / ↓
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With