Adding {} indented inside by pressing ctrl + enter


#1

I write a lot of styles (LESS, SCSS), want by pressing ctrl + enter to insert the braces with a line break in and right indent and get the cursor to the position just after a tab

before:

.some-selector| // <- cursor position

after:

.some-selector {
  | // <- cursor position
}

I was faced with two challenges:

  1. by pressing ctrl + enter the code does not work: https://gist.github.com/nicothin/d9614ef7332cd069d3c5e0af088285db#file-keymap-cson-L34-L36
  2. I can not understand how can I get the number and type of padding for the row with a specific number: https://gist.github.com/nicothin/d9614ef7332cd069d3c5e0af088285db#file-init-coffee-L13-L22

any ideas?


#2

If you press { and then enter, you’ll get the same results. What do you need that the default process can’t accomplish?