Emacs - override indentation

后端 未结 6 1226
悲&欢浪女
悲&欢浪女 2020-12-29 23:24

I have a multiply nested namespace:

namespace first {namespace second {namespace third {
              // emacs indents three times
    // I want to intend h         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-30 00:26

    Use an an absolute indentation column inside namespace:

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

    Then use c-set-style to use your own style.

    Note that this only works in c++-mode, c-mode doesn't know 'innamespace'.

提交回复
热议问题