是否可以更改Xcode缩进注释块的方式? [英] Is it possible to change the way Xcode indents comment blocks?

查看:457
本文介绍了是否可以更改Xcode缩进注释块的方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Xcode自动在C风格的注释块中缩进一行代码:

By default, Xcode automatically indents multiple lines of code within C-style comment blocks by one space:

/* this is a comment block
 line 1
 line 2
*/

是否可以修改此行为?

Is it possible to modify this behaviour? I would prefer to have no indentation within comment blocks.

推荐答案

这不是一个完整的答案,但Xcode有代码格式选项键 XCCodeSenseFormattingOptions。

This is not a complete answer, but Xcode has code formatting options under the key XCCodeSenseFormattingOptions.

您可以通过命令行或编辑plist设置选项:

You can set the options via command line or by editing the plist:

defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict PreExpressionsSpacing  "" PreCommaSpacing " "

不幸的是,我在注释块中找不到任何空格缩进的设置,这让我很疯狂。

Unfortunately, I cannot find any setting for the one space indentation in comment blocks, and it makes me crazy!

这篇关于是否可以更改Xcode缩进注释块的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆