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

By | January 7, 2016

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.

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

  1. Pingback: Restrict Blank Line Cut or Copy while coding in Visual Studio

  2. Pingback: 9 Hidden Features of Visual Studio that you should know

Comments are closed.