Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a shortcut in Visual Studio to move down multiple lines but keep the cursor in the same place?

CTRL+down arrow does this, but only 1 line at a time. Is there a shortcut to skip multiple lines but keep the cusor in the same place? You'd expect CTRL+page down to do it, but this just puts the cursor at the bottom of the screen.

like image 885
NibblyPig Avatar asked Mar 03 '10 10:03

NibblyPig


People also ask

What is Ctrl K in visual studio?

Ctrl+K for Removing Bookmarks Visual Studio contains a characteristic that enables users to add a bookmark. This bookmark can be added to a line of code in a solution.

How do I move multiple lines in Visual Studio code?

Ctrl + Shift + Alt + down arrow. Ctrl + Shift + Alt + up arrow.

How do I move a line down in visual studio?

Move Code Alt+Up/Down This keyboard shortcut is new in Visual Studio 2013. If you put the cursor on a line of code and use the Alt+Up Arrow keys, the line of code you've selected moves up. If you use the Alt+Down Arrow keys, the line of code selected moves down.


1 Answers

Tools + Options, Text Editor, pick your language or use All Languages, tick "Enable virtual space". That ensures that the caret stays in the same column when you move it vertically, no matter what text is in a line. Very much my personal preference.

Tools + Macros + Record is an easy way to generate the macro you want. Tools + Customize + Keyboard to assign it a shortcut key.

like image 50
Hans Passant Avatar answered Oct 07 '22 00:10

Hans Passant