4

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

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

becomes

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};

becomes

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.