electric-pair has an electric-pair-skip-whitespace config that accepts 'chomp to delete any whitespace between point and the matched closing delimiter. Does smartparens have something like that? I haven't found anything like that in the sample configs o wiki, but maybe it has a different name.

To clarify the behavior I'm looking for is:

{ abcd |

:=> type '}'

{ abcd }|

1 Answer 1


You can do this by providing some post-hooks manually (feel free to contribute useful code :). Another setting is to enable sp-navigate-reindent-after-up which will reformat your sexps when you call sp-up-sexp (which in strict mode will be called when you hit } in your example --- or you can set sp-autoskip-closing-pair to always).

There is no global setting like the one electric-pair has, global settings led to great many problems in smartparens so we are trying to eliminate as much of them as possible.

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.