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 XCod开发者_如何学JAVAe 4 does not seem to adhere to the rule.
defaults write com.apple.Xcode XCCodeSenseFormattingOptions -dict BlockSeparator "\\n"
Any suggestions?
Thanks.
The following has worked with my XCode 4 installation:
defaults write com.apple.Xcode XCCodeSenseFormattingOptions '{ "BlockSeparator" = "\n" ; }'
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.
精彩评论