Here is one Visual Studio tip from my colleague Gwyn Peña-Siguenza which I didn’t know about! Yes, even after 26 years using this fantastic tool, I am still discovering new features. So thanks to Gwyn for this!! This is all about deleting lines, and using the Windows Clipboard for support.
You can see the short video on our YouTube channel, and there is also a longer video with 20 must-know shortcuts here. Don’t forget to subscribe if you want to learn more tips!
Using the Clipboard History in WindowsOne of my favorite tools on Windows is the Clipboard History. This feature was introduced in Windows 10 and is seriously adding productivity to my day-to-day. If you haven’t been using it, you need to enable it in the Windows settings. Simply follow the steps:
Windows Clipboard settingsTo test that this works, try the following:
This enables you to copy multiple pieces of content in a document without having to always Ctrl-Tab back and forth between the original document and the target document. And the cool thing is that it even supports images!
Windows Clipboard history with two items of text and one imageDeleting a line with clipboard supportSo why am I bringing this up? Well another thing that we do quite often in code is deleting lines. There’s even a joke that the best developers are not the one writing a lot of lines of code, but those who delete a lot of lines of code
In order to delete a whole line, most people would follow these steps:
This is a lot of steps for a simple operation that we do a LOT in a developer’s day. Thankfully you can simplify it.
That’s it. The line is deleted and there is no empty line remaining where it was. but the best part is, this line was saved in the Clipboard! To test this, simply press Win-V and you should see the line you just deleted on top of the history. Of course this also works for multiple lines.
Deleting a line without clipboard supportNow, sometimes you don’t want the deleted line(s) to be saved to the Clipboard history. In this case, follow these steps:
This way you can keep your Clipboard history tidy.
More tips about Visual StudioHopefully these tips help you to be more productive! And if you want to learn more about key shortcuts in Visual Studio, you should watch Gwyn’s 5:30 minutes video on the Visual Studio YouTube channel.
The post Visual Studio tip: Using Ctrl-L to delete a line with and without Clipboard backup appeared first on Visual Studio Blog.