Question

When I write C++ code in emacs, there is a problem:

template <typename ROLE_BASIC_ARRAY, typename Index0T,  
..........typename Index1T = NullIndex1<typename

but I want to indent like this:

template <typename ROLE_BASIC_ARRAY, typename Index0T, 
....typename Index1T = NullIndex1<typename  

How can I configure my emacs ? thanks.

Was it helpful?

Solution 2

done used code:

(c-add-style "microsoft"
          '("stroustrup"
            (c-offsets-alist
             (innamespace . -)
             (inline-open . 0)
             (inher-cont . c-lineup-multi-inher)
             (arglist-cont-nonempty . +)
             (template-args-cont . +))))
(setq c-default-style "microsoft")

http://www.emacswiki.org/emacs/IndentingC

OTHER TIPS

Here is how you should do it

(setq-default c-basic-offset 4)

Reference: http://www.emacswiki.org/emacs/IndentingC

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top