Did you know – In Visual Studio you can copy multiple code blocks together and paste them one by one ?

Did you know – In Visual Studio you can copy multiple code blocks together and paste them one by one ?

Have you ever wonder if you could copy multiple lines of code and past them as and when need. Wouldn’t it improve your development productivity? Just copy multiple code block, and past them as and when need. Well, this is another hidden feature of Visual Studio and either many of us never used it or generally forget about it ! But it is there since beginning. This built-in feature is known as “Clipboard Ring”.  The way it works is very simple; all the cute / copy text items are stored in a memory and you can use them as and when need by paste.

for Cyclic paste from the Clipboards, you need to paste using Ctrl+Sift+V

So, this is how it works.

  • Copy / Cut number of code blocks.
  • Paste them using Ctrl+Shit+V Option
  • use the same key set to paste the information as long as you are not seeing the right code block for you.

 

The clipboard store only the last 15 text items in the memory

Related Post: How to Place your reusable code into Toolbox in Visual Studio?

For an example, consider you have following blocks of  code snippet and you did copy of three different code segments one by one as highlighted below.image

Now, you have three different code block in the clipboard, start pressing Ctrl+Shift+V , as long as you are not getting your required code block.

image

You can continue copy code block again after / during the past, and clipboard would keep last 15 items in memory. This is very very powerful feature if you can you it in a right way.

Hope this helps.

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

6 Comments to “Did you know – In Visual Studio you can copy multiple code blocks together and paste them one by one ?”

Comments are closed.