0

I want to expand else {|} (second parentheses generated by smartparens) into

else {
  |
}

which is the best sequence of keys or options?

1
  • 1
    There is a very similar question with a nice answer: stackoverflow.com/a/35469843/1365754. With smartparens you can add a local pair to do this. I have one for css-mode for instance: (sp-local-pair 'css-mode "{" nil :post-handlers '(:add ("||\n[i]" "RET"))). Then if you press RET when at { | } this will do what you want I think.
    – Hubisan
    Commented Apr 29, 2020 at 14:40

1 Answer 1

1

The easiest way I can think of is to open a new line with C-o then RET.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.