Do you know that, Visual Studio allows you to cycle through your Clipboard data to paste the right content that you copied previously? This built-in feature is known as Cycle Clipboard Ring and can be invoked using a keyboard shortcut.
In this part of my Visual Studio Productivity Tips series, let's learn how to cycle through your Visual Studio clipboard and make your life easy while copy/pasting code.
Visual Studio Productivity Tips:
When you press Ctrl + C OR Ctrl + X in Visual Studio to Copy OR Cut a text content or code block, the Visual Studio Editor keeps the last 15 copied content in memory. This allows you to cycle through your Clipboard and paste the right code block using the built-in feature named "Clipboard Ring".
You can either invoke it from the Visual Studio menu Edit | Cycle Clipboard Ring or from the keyboard shortcut Ctrl + Shift + V (don't use default paste or Ctrl + V). Let's see how it works, with a simple example:
- Open your Visual Studio Editor and navigate to an existing project.
- Open a code file and select few lines. Now press Ctrl + C to copy the selected code block.
- Select few more lines from different part of the code file and press Ctrl + C to copy the second code block.
- Similarly, navigate to another code file and select the third code block. Now press Ctrl + C again to copy the selection.
- Till now we have copied three code blocks into our Clipboard memory. Now time is to cycle through them and paste the desired code block.
- Now, move to a different code line or file to paste the copied content.
- Now, either from the Visual Studio menu click on Edit | Cycle Clipboard Ring or press Ctrl + Shift + V keyboard shortcut. Keep pressing until you find the desired code block that you wanted to paste.
That's all. If you heard about this feature for the first time, try it out now. You will find it very useful and this will definitely improve your productivity while using the Visual Studio editor. Do note that, Visual Studio keeps a max of 15 items in its Clipboard memory.
Don't forget to check out the other posts on my Visual Studio Productivity Tips series. Do share your views with us.