Cut or Delete the Current Line

Tips Search

If you like the tips then you'll love the book!

Order your copy today:
http://www.amazon.com/gp/product/0735649928

Cut or Delete the Current Line

  • Comments 5

Keyboard:  CTRL + L (cut text); SHIFT + DEL(cut text and carriage return); CTRL + X(cut text and carriage return); CTRL + SHIFT + L (delete)
Command:  Edit.LineCut; Edit.Cut; Edit.Cut; Edit.LineDelete
Versions:  2008,2010
Published:  4/4/2010
Code:  vstipEdit0038

 

You can quickly and easily do a cut operation by doing the following:

  1. Place your cursor on any line:
    image
  2. Do one of the following commands:
    1. CTRL + L to cut the text only
    2. SHIFT + DEL or CTRL + X to cut the line and the carriage return at the end of the line

If you want to DELETE the line instead you can use CTRL + SHIFT + L

  • Hey Now Zain,

    Never tried Ctrl + L for Line & Ctrl + Shift + L for del Line before today.

    Thx 4 the info,

    Catto

  • Catto!

    So...do you like the keystrokes?  How are they working for you?

    Z

  • Hi,

    I do not see any difference between CTRL + L and CTRL + X Im my VS2008 both cut the whole line including the carriage return.

    And I'd really wish that CTRL + X (and even more CTRL + C) would do nothing, if no text ist selected. Countless times I lost text in the clipboard because I accidently pressed CTRL + C instead of CTRL + V (Paste).

    Thanks for your daily tips, they rock!

    Thomas

  • @Thomas for your copy empty text problem there is a setting you can change to avoid it. Tools -> Options -> Text Editor -> All Languages -> General -> unselect "Apply cut and Copy Command to empty lines" Also the your previous copied content arent lost you can find the lates (20) by pressing ctrl + shift + V.

  • Good catch Jonas, this one totally got by me.  The tips for that can be found here:  blogs.msdn.com/.../how-to-keep-from-accidentally-copying-a-blank-line.aspx

Page 1 of 1 (5 items)
Leave a Comment
  • Please add 8 and 7 and type the answer here:
  • Post