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
Most code editors have support for that built in
Rider and VS and VS Code all do, thats for sure.
is that specific shortcut?
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 classicUnderstood,
Ctor
ah yep, good shout
thats a crucial one
I don't know any of those shortcuts 😦
I think you're trolling me
I'm not.
never used snippets personally
just completion suggestions with tab + fast typing is good nuff
press ctrl + space and scroll down it lists the shortcuts
that's a new one for me
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
I see
Try chars.for
That might be resharper though
Oh nice
Think of the keystrokes I could have saved...
Over the decades
Enough keys for your whole life
For
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: [email protected]
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...