Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove default code snippets in Xcode 6

Anyone use default code snippets in Xcode? There are too many useless code snippets there, such that I don't even want to create my snippets there. So looked for answers on ST, but they did not help much.

Is there any improvement so I can remove code snippets in Xcode 6?

For further question, can I import or export customised snippets, so I can use them across different computers?

Thanks a lot,

like image 929
allenlinli Avatar asked Dec 09 '22 05:12

allenlinli


2 Answers

Yes you can delete the default snippets. Since snippets are saved in XML in a plist file at the path:

/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/SystemCodeSnippets.codesnippets

You can create an empty snippets file in TextEdit with the following code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">
    <array></array>
</plist>

And save it as SystemCodeSnippets.codesnippets. Replace it with the file in the folder named above and there are no default system snippets anymore.

like image 122
Binarian Avatar answered Dec 10 '22 17:12

Binarian


In Xcode 10 the default snippets are at

/Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.framework/Versions/A/Resources/SystemCodeSnippets.codesnippets

To remove contents change it to

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array></array>
</plist>
like image 44
Jano Avatar answered Dec 10 '22 19:12

Jano