I would like to automatically add spaces between braces and content when using emacs, for example:

std::vector<std::string> values{"content", "moreContent", "andMoreContent"};


std::vector<std::string> values{ "content", "moreContent", "andMoreContent" };

when pressing }. I'm already using autopair-mode which automatically pairs braces and quotes. Another example, when declaring variables:

int myVar{5};


int myVar{ 5 };

How do I do this?

Your Answer

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

Browse other questions tagged or ask your own question.