views:

223

answers:

5

I already know about Control-L to delete an entire line...is there one to just select an entire line (which I can then copy and paste somewhere else...)

+4  A: 

Hit

  • Home
  • Shift + End
Redburn
+3  A: 

It's Home+Home, then Shift+Down for me.

Or you change that setting which makes Ctrl+C with no selection copy the line. But I hate that, so I always turn it off. (Thanks to Bala for providing the link to that setting!)

To cut a line, Ctrl+L works in my keyboard settings.

sbi
How do you show the button images? :O
LnDCobra
Button styles even*
LnDCobra
@LnDCobra: It's a tag: `<kbd>Ctrl</kdb>`.
sbi
+11  A: 

You can also use Ctrl-X to cut an entire line.
Similarly, you can use Ctrl-C to copy an entire line.
As long as you don't have anything selected, the command will work on the entire line.

Task
I love this feature :)
LnDCobra
You can also use Shift-Del to cut the line, and Ctrl-Insert to copy it.
Xavier Nodet
+2  A: 

I believe, if you don't have any selection and press Control-C, it would copy the line.

Bala R
Here is the setting that sbi is talking about.http://codereflect.com/2010/04/11/visual-studio-2010-tips-cut-copy-operations-on-unselected-lines/
Bala R
awesome, that works great
Albert
+1  A: 

Visual Studio macros are another way to do these types of operations if you can't find an existing command. A simple way to create one is:

  • Use the Record TemporaryMacro option (under Tools/Macros).
  • Select the line however you prefer (e.g., home, shift, end).
  • Click Stop Recording (under Tools/Macros).
  • Choose Save TemporaryMacro (under Tools/Macros).
  • Then choose Tools/Customize/Keyboard and assign a shortcut to the macro.
Mark Wilkins