Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Best Code Editor Keyboard Shortcuts In Visual Studio For More Productivity
WhatsApp
Habibul Rehman
4y
32.5k
0
9
100
Article
Every developer wants to improve their productivity while coding, so it's very critical to know a few basic Visual Studio code editor keyboard shortcut keys, that will improve your coding style and productivity. It will help you to stop donkey work while coding and work more professionally, such as moving code inside the text editor.
Move Code
So let's see how to do this.
Select your code inside Visual Studio Text Editor that you want to move.
Then hold down the alt key and press up arrow and down arrow to move your code around the Text Editor.
Previ
ew
alt + up/down arrow
Duplicate Code
Let's see how to do this.
Select your code inside Visual Studio Text Editor that you want to duplicate.
Then hold down the ctr key and press the d button to duplicate your code inside the Text Editor.
Preview
ctrl + d button
Wrap code with different statements
Let's see how to wrap your code statements with foreach statement.
Select the code that you want to wrap by using the mouse or pressing Shift+ Right/Left arrows.
Then hold down the ctr key and press k+s button. A popup window will show all the basic statements available.
Search and select your desired one, I'm going to select the foreach statement and press the enter button.
Preview
ctrl + k + s button
Comment/Uncomment code
Let's see how to comment and uncomment code using keyboard shortcut key inside Visual Studio code editor.
Select the desired code that you want to comment.
Then hold down the ctr key and press k+c for comment the code.
To uncomment the code, hold down the ctr key and press k+u.
Preview
ctrl + k + c button for comment / ctrl + k + u button for uncomment
Code formating
Let's see how to format selected code or complete code document in VisualStudio code editor with keyboard shortcut keys.
Format Document - Hold down the ctr key and pres k + d to format the complete document.
Format Selection - Hold down the ctr key and press k + f to format selected code inside the document.
Preview
ctrl + k + s button
Summary
In this article, we learned how to move code, duplicate code, wrap code with statements, comment/uncomment code and do code formating using Visual Studio code editor keyboard shortcut keys. You will find these shortcuts very helpful in your daily life coding.
Code
Duplicate Code
Formating
Keyboard
Move Code
Shortcuts
Statements shortcuts
VisualStudio
Wrap Code
Up Next
Ebook Download
View all
Printing in C# Made Easy
Read by 22.3k people
Download Now!
Learn
View all
Finchship
We Provide Web, Desktop and Mobile Apps Solution
Membership not found