Search
Get Started
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
(
)
{
}
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,010
Members
View on Discord
Was this page helpful?
Yes
No
P
Pobiega
•
12/18/23, 12:16 AM
Most code editors have support for that built in
P
Pobiega
•
12/18/23, 12:16 AM
Rider and VS and VS Code all do
, thats for sure
.
K
Kru
OP
•
12/18/23, 12:17 AM
is that specific shortcut
?
P
Pobiega
•
12/18/23, 12:18 AM
nah
, you just type the opening brace
P
Pobiega
•
12/18/23, 12:18 AM
and the editor automatically does the rest
P
Pobiega
•
12/18/23, 12:18 AM
there are also snippets for creating classes
, properties
, etc
P
Pobiega
•
12/18/23, 12:18 AM
is a classic
K
Kru
OP
•
12/18/23, 12:20 AM
Understood
,
P
Pobiega
`prop<tab><tab>` is a classic
M
Mayor McCheese
•
12/18/23, 12:37 AM
Ctor
P
Pobiega
•
12/18/23, 12:37 AM
ah yep
, good shout
P
Pobiega
•
12/18/23, 12:37 AM
thats a crucial one
M
mtreit
•
12/18/23, 12:37 AM
I don
't know any of those shortcuts
M
mtreit
I don't know any of those shortcuts 😦
M
Mayor McCheese
•
12/18/23, 12:38 AM
I think you
're trolling me
M
Mayor McCheese
I think you're trolling me
M
mtreit
•
12/18/23, 12:39 AM
I
'm not
.
D
dio
•
12/18/23, 12:39 AM
never used snippets personally
D
dio
•
12/18/23, 12:39 AM
just completion suggestions with tab
+ fast typing is good nuff
J
jen
•
12/18/23, 12:39 AM
press ctrl
+ space and scroll down it lists the shortcuts
D
dio
•
12/18/23, 12:41 AM
that
's a new one for me
M
mtreit
I'm not.
M
Mayor McCheese
•
12/18/23, 12:46 AM
Prop creates a property
, ctor creates a constructor
, there are others like try
, tryf
, etc
M
Mayor McCheese
•
12/18/23, 12:47 AM
Some ides allow someCollection
.for tab
M
Mayor McCheese
•
12/18/23, 12:47 AM
And it creates a for loop
M
Mayor McCheese
And it creates a for loop
M
mtreit
•
12/18/23, 12:48 AM
M
mtreit
•
12/18/23, 12:48 AM
I see
M
mtreit
Click to see attachment
M
Mayor McCheese
•
12/18/23, 12:49 AM
Try chars
.for
M
Mayor McCheese
•
12/18/23, 12:50 AM
That might be resharper though
M
mtreit
•
12/18/23, 12:50 AM
Oh nice
M
mtreit
•
12/18/23, 12:50 AM
Think of the keystrokes I could have saved
.
.
.
M
mtreit
•
12/18/23, 12:51 AM
Over the decades
M
mtreit
Over the decades
M
Mayor McCheese
•
12/18/23, 12:52 AM
Enough keys for your whole life
M
Mayor McCheese
•
12/18/23, 12:52 AM
For
M
mtreit
•
12/18/23, 12:52 AM
K
Kru
OP
•
12/18/23, 12:52 PM
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
YouTube
Andrew Renko
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
.
.
.
prop<tab><tab>
prop<tab><tab>