C# function thing


#1

Hi all,
I have recently started using atom to code with. I was using visual studio before and when I typed:

void RandomFunction () { }

And pressed enter inside the curly braces, it automatically changed to:

void RandomFunction ()
{

}

It was really useful for me typing quickly, and i was wondering if there was a package that would allow me to do that.
I dont want to go back to vs because I really like the syntax highlighting, and packages that are offered on atom.

Many thanks,
Josh


#2

Atom has a snippets feature that does exactly what you want. Add this to your snippets.cson and try it out:

'.source.c':
  'Curly Bracket Formatting':
    prefix: ') {'
    body: ')\\\n{\\\n$1\\\n'

#3

Thank you so much!

I had to change the ‘.source.c’ to ‘.source.cs’, but other than that it works perfectly! :blush: