B
B
BelBES2014-12-18 15:04:43
emacs
BelBES, 2014-12-18 15:04:43

How to change the formatting style of C++ code in EMACS?

Hello.
The question is:
I currently have default formatting for C++ code in emacs, and when creating a namespace, it always makes omissions inside it, like this:

namespace qqq
{
       void qqq();
      ....
}

But I want there to be no missing entries inside the namespace by default and the code would look like this:
namespace qqq
{
void qqq();
....
}

Can anyone suggest how to set this up? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
demiol, 2014-12-18
@BelBES

(c-add-style "my" '("gnu"
                     (c-offsets-alist . ((innamespace . [0])))))

(add-hook 'c++-mode-hook (lambda ()
                           (c-set-style "my")))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question