【问题标题】:emacs C++ enter indention set to 4 spaceemacs C++ 输入缩进设置为 4 个空格
【发布时间】:2014-05-13 05:51:32
【问题描述】:

我在emacs中写C++代码的时候,出现了一个问题:

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

但我想像这样缩进:

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

如何配置我的 emacs ?谢谢。

【问题讨论】:

标签: c++ emacs


【解决方案1】:

你应该这样做

(setq-default c-basic-offset 4)

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

【讨论】:

    【解决方案2】:

    完成使用的代码:

    (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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-07
      • 2010-09-09
      • 2011-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多