0

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

else {
  |
}

which is the best sequence of keys or options?

  • 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 Apr 29 at 14:40
1

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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