Based in part on the advice in this response to a question on SO, I tried replacing /Developer/Library/Xcode/PrivatePlugIns/IDECodeSnippetLibrary.ideplugin
with an alias to an exact copy in a Dropbox folder, but doing so caused Xcode 4.2 to crash due to an internal logic error.
I want to sync the snippets on my work and home machine. Right now I'm using Alfred for snippets, but it'd be nice to have Xcode handle the snippets, for convenient tab jumping and intellisense. Has anyone out there attempted something similar?
Code snippets are stored in your ~/Library/Developer/Xcode/UserData/CodeSnippets directory. To share your code snippets, simply copy them from this directory. Each code snippet file is a standalone plist file with a universally unique identifier (UUID) as the file name followed by .
So, What is a Code Snippet? "Code Snippet" is a term used to describe a small portion of re-usable source code, machine code, or text. They allow a programmer to avoid typing repetitive code during the course of routine programming.
I guess sharing your own (not the system) snippets is fine. Then, try replacing
~/Library/Developer/Xcode/UserData/CodeSnippets
with a symbolic link to your shared folder.
Something like: (in Terminal app)
cd ~/Library/Developer/Xcode/UserData
mv CodeSnippets /path/to/shared/folder/
ln -s /path/to/shared/folder/CodeSnippets CodeSnippets
Repeat in any Mac in which you want to access shared snippets.
as i do and it work.
simply copy your code snippets in
~/Library/Developer/Xcode/UserData/CodeSnippets/
if your didn't made any custom code snippets before then you have to copy whole 'CodeSnippets' dir to path
~/Library/Developer/Xcode/UserData/
now simply close the xcode from activity monitor and start it again you will get new code snippets.
/ use the following code to show hidden file / apply this command one by one in teminal
defaults write com.apple.Finder AppleShowAllFiles TRUE
killall Finder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With