Remove default code snippets in XCode 4

两盒软妹~` 提交于 2019-12-03 17:47:31

问题


I want to delete some of the default code snippets in XCode 4 because I want the beginning curly brace to start on a new line. I tried the following but XCode 4 does not seem to adhere to the rule.

defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator "\\n"

Any suggestions?

Thanks.


回答1:


The following has worked with my XCode 4 installation:

defaults write com.apple.Xcode XCCodeSenseFormattingOptions '{ "BlockSeparator" = "\n" ; }'



回答2:


The "defaults write" commands have not worked for me. I got around this by adding a new code snippet with the beginning curly brace on a new line. The next time I typed 'if' I got the built-in completion but since selecting my completion from the drop-down, I now always get my completion.

See more on code snippets here: http://developer.apple.com/library/mac/#documentation/IDEs/Conceptual/Xcode4TransitionGuide/Orientation/Orientation.html#//apple_ref/doc/uid/TP40009984-CH5-SW1

Edit: And a bit more here: http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/Editing/Editing.html#//apple_ref/doc/uid/TP40010215-CH8-SW2

But not very in-depth, the only way I can see to include a replaceable piece of text (e.g. 'conditions' in the 'if' snippet) is by copying from a snippet in the code editor.



来源:https://stackoverflow.com/questions/5265448/remove-default-code-snippets-in-xcode-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!