C
C#2y ago
Kru

Block of code

How do people create block of code real fast in format using {}. I see them type {} and next thing it shows up as follows. static void something() { }
20 Replies
Pobiega
Pobiega2y ago
Most code editors have support for that built in Rider and VS and VS Code all do, thats for sure.
Kru
KruOP2y ago
is that specific shortcut?
Pobiega
Pobiega2y ago
nah, you just type the opening brace and the editor automatically does the rest there are also snippets for creating classes, properties, etc prop<tab><tab> is a classic
Kru
KruOP2y ago
Understood,
Mayor McCheese
Ctor
Pobiega
Pobiega2y ago
ah yep, good shout thats a crucial one
mtreit
mtreit2y ago
I don't know any of those shortcuts 😦
Mayor McCheese
I think you're trolling me
mtreit
mtreit2y ago
I'm not.
dio
dio2y ago
never used snippets personally just completion suggestions with tab + fast typing is good nuff
jen
jen2y ago
press ctrl + space and scroll down it lists the shortcuts
dio
dio2y ago
that's a new one for me
Mayor McCheese
Prop creates a property, ctor creates a constructor, there are others like try, tryf, etc Some ides allow someCollection.for tab And it creates a for loop
mtreit
mtreit2y ago
No description
mtreit
mtreit2y ago
I see
Mayor McCheese
Try chars.for That might be resharper though
mtreit
mtreit2y ago
Oh nice Think of the keystrokes I could have saved... Over the decades
Mayor McCheese
Enough keys for your whole life For
mtreit
mtreit2y ago
catlul
Kru
KruOP2y ago
oh wow, this blew up. I did some digging around and found out that, VS Studio does not return the {} in the code block. See below. There are short cut you can use but no easy way to do it, unless you do the whole code block using TAB, TAB. https://www.youtube.com/watch?v=1hmF00u2uF4
Andrew Renko
YouTube
How to quickly put curly braces on a new line in VS Code (no plugin...
CTRL + ← (twice) & Enter. After that, u can press ↓ to go to method's body & Tab to add the formatting indentation. Email: qwertyprostudio@gmail.com Personal Facebook: www.facebook.com/profile.php?id=100003771365277 Telegram: @qwertyrecords VK community: vk.com/qwertyrecords https://www.fiverr.com/andrew_renko Instagram: www.instagram.com/andr...

Did you find this page helpful?