Search
Sunday, November 18, 2018 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Blogroll  
     
  
   Disclosure  
All blog entries are the opinions of the author and do not necessarily reflect the opinions of their employer. All the code presented is for explanation and demonstration purposes only. Any damages incurred to your site and/or data are not the responsibility of the author. Every effort is taken to ensure the code properly compiles, however sometimes there are some hiccups and you might be required to do your own debugging.
     
  
   TechTidBits (Blog)  

VS Tnt #6: Opening up lines above and below

Nov 18

Written by:
Thursday, November 18, 2010 8:58 PM  RssIcon

Visual Studio Tips'n'TricksWhen you want to add a new line of code, what do you do?  Do you do the END-ENTER-TAB-TAB-TAB dance?  Cha cha cha?!  Read on for a quick shortcut!

Visual Studio Tips'n'TricksTip'n'Trick: When you're in the middle of a line of code, open up a new row and start coding immediately.

Shortcut: CTRL+SHIFT+ENTER = Opens up line below and CTRL+ENTER open up a line above.

Da "Peter" version (aka, ya, da verbose one)

As you're coding, you'll inevitably want to insert lines of code either above or below where you currently are located.  How do YOU do it?  Do you do the END-ENTER-TAB-TAB-TAB dance?  Cha cha cha?!

Take the example below, see where the cursor is currently located?  Right in the middle of the WriteLine right?  Ok, if you wanted to entere a line below, just hit ....no no no, not the END key, no, that's the VB6 way of doing things.......so......'99!  DOH! hahaa  Prince called, he wants his party back! (hey, I'm a geek, you're here for the tips'n'tricks not the comedy right? LOL)

Code sample

But seriously, to help you keep your train of thought going, you want to get to the next line of code as quickly as possible right?  Cool!  Right from the MIDDLE of the line, press CTRL+SHIFT+ENTER and boom, you've opened up a line below, you're tabs are all there, AND you're typing in the right spot in code.  Change you mind?  No problem, CTRL+Y will undo your changes (that's a free TnT LOL), then hit the CTRL+ENTER to open up a line above where you are right now and just like before, you're cursor is ready for you to start typing your code immediately!  Cool eh?

Now that you know how to open up lines above and below your current place in code, it's time to grab a coffee and get coding!

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

2 comment(s) so far...


Re: VS Tnt #6: Opening up lines above and below

didn't know about this one. I've been a short cut junkie ever since I started learning tips and tricks like this. The only problem is that some of the default VS shortcuts seem to conflict with Code Rush so I have to pick and choose which to implement.

By Ren on   Thursday, November 18, 2010 9:44 AM

Re: VS Tnt #6: Opening up lines above and below

Hi Ren! Cool to meet another keyboard junkie! Awesome! I understand your dilema all too well, which is why I've historically avoided going to something like Resharper because of losing/choosing/relearning shortcuts. (the cost of the tools also factors into the decision too haha).

Glad I could help you out Ren. I hope you come back for some more of these TnTs in the future! Thanks for leaving me a comment, after a few of these, I was wondering about their usefullness but since you commented, I'm (hoping? LOL) thinking there are a few others out there watching too. Have a good one!

By phenry on   Thursday, November 18, 2010 10:07 AM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement