Vadim's Weblog

Never stop learning.

Copy and Paste in Visual Studio and MS SQL Server Management Studio.

Posted by Vadim on March 21, 2007

I realized that many people don’t know how easy Visual Studio or SQL Server Management Studio allows us to copy, cut & paste. I’m sure that many of you know that but if you don’t, please give it try I’m sure that you’ll save some time.

Even my mother knows Ctrl-C, Ctrl-X, & Ctrl-V shortcuts to copy, cut, & paste. But do you know that you don’t need to select a line to copy/cut it. Just move cursor to the line you want to copy/cut and press Ctrl-C or Ctrl-X, the whole line will be copied into the clipboard.
We copied a line, now we can paste it. The line always will be posted above the line where you cursor is. And you cursor can be in any position on that line; I repeat ANY position of the line.
Do you know that you can cycle through the clipboard ring? Here’s the example where we are going to swap ‘var1’ and ‘var2’ words:

public void foo()
{
string s1 = "var1";
string s2 = "var2"
}

  • First double click on word ‘var1’, to select it and then press Ctrl-C, to put the selection into the clipboard.
  • Next double click on word ‘var2 and press Ctrl-C again. Now we have both selections in the clipboard.
  • Now double click on word ‘var1’ again and replace it with ‘var2’ by pressing Ctrl-V. So far nothing new.
  • Last, double click on word ‘var2’ on the next line where we’re declaring variable s2 and press Ctrl-Shift-V twice (it means two times :) ).

kick it on DotNetKicks.com

About these ads

9 Responses to “Copy and Paste in Visual Studio and MS SQL Server Management Studio.”

  1. Will Ballard said

    I recall there used to be a toolbox panel that showed the contents of the clipboard ring that seems to have disappeared in VS 2005. You have any idea where that is?

  2. […] to play with Silverlight 2.0 Beta 1.  Working with Visual Studio I got so used to be able to cut and paste a row without a selecting a line.  When you work with XAML, Ctrl-C will copy a line without a selecting a line (expected […]

  3. Sergey said

    Thanx!! Nice finding!

  4. […] Vadim Kreynin has posted a few good tips on Copy and Paste in Visual Studio and MS SQL Server Management Studio. […]

  5. Ketan said

    This is a great little tip, thanks.

  6. Use http://bluemars.org/clipx/ for handling your clipboard history

  7. Nicopoy said

    And any idea how to disable it in Visual Studio ? I find it more boring than useful…

    For example :
    Copy (Ctrl-C) some text, go to the place where you want to paste it, and then you hit Ctrl-C instead of Ctrl-V (yes, I have big fingers)… Well you can’t paste your text any more, you have to go back, copy again, and paste. And when you had cut the text, you even have to undo !

    Just found something in the options, but only for cutting/copying empty lines. Good, but just not enough…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: