Emacs C++-mode incorrect indentation?

前端 未结 5 1751
我在风中等你
我在风中等你 2020-12-07 12:54

I\'m running emacs 23 with c++-mode and having some indentation problems. Suppose I have this code:

void foo()
{
   if (cond)
     { <---
        int i;
          


        
5条回答
  •  轮回少年
    2020-12-07 13:29

    Before tuning individual offsets, configure preferable style. I use stroustrup, you my try some others, see http://www.emacswiki.org/emacs/IndentingC#toc1 for names and http://en.wikipedia.org/wiki/Indent_style#Variant:_Stroustrup for examples

    M-x customize-variable c-default-style (and set your preferred for C++_

提交回复
热议问题