c - 在 Xcode 中,如何禁用缩进宏处理?

标签 c xcode indentation

在 Xcode 4.0 中,默认情况下,缩进如下所示:

#ifdef SYNTHETIC
    char buff_inarray[100];
#else
    char buff_in;
#endif

但是,我希望它是更简单的版本,例如:

    #ifdef SYNTHETIC
    char buff_inarray[100];
    #else
    char buff_in;
    #endif

如何设置?

最佳答案

您不能修改 Xcode 缩进设​​置。您将不得不使用不同的编辑器并自行重新缩进所有代码。

您最多只能禁用自动缩进。它在 Xcode 的首选项 → 文本编辑 → 缩进中完成。这张照片来自 Xcode 5,但我很确定版本 4 也有它。

Autoindent settings

此外,使用第 0 列中的预处理器宏是一种常见的编码约定,所有程序员都希望它在那里。原因不是代码本身(应该缩进),而是要编译的代码。

关于c - 在 Xcode 中,如何禁用缩进宏处理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20959854/

相关文章:

ios - 进入 TabBarController 的特定 ViewController

从现有枚举常量创建一个新的枚举常量

c - sizeof 作为字符串维度的段错误

ios - UIViewContentModeRedraw 与 setNeedsDisplay?

ios - 预期返回 'UICollectionViewCell' 的函数中缺少返回值

python - 编译Python代码时出现unindent does not match any external indenting level错误

vim - 删除 Vim 中行前的所有任意空格

emacs - 将注释设置为与所有表单相同的缩进级别

c 程序计算系统内存使用量?

为 Linux : Void value not ignored as it ought to be 编译 Wifi 驱动程序