Migrating Code Snippets from Monodevelop to Xamarin Studio

Migrating Code Snippets

Ofcourse you have installed the Xamarin Studio IDE and you have been checking it out and perhaps even coding on your latest project with this beast!
After sniffing around and working in this fast-n-clean IDE one thing begins to show itself, sadly:

Where are all those sweet Code Snippets that I defined and used in Monodevelop 3.0?
It seems that installing Xamarin Studio != upgrading your Monodevelop IDE but it acts as a standalone new tool. This means no take-along of code snippets… 🙁

Luckily there is a cure for this pain

If you’re like me and have quite some Code Snippets that you use you’ll be shocked to find out that the preferences interface of Xamarin Studio doesn’t allow you to easily copy-paste the whole bunch from your MonoDevelop preferences screen.

Lucky for us devs, all the snippets seem to be stored on your machine (as explained here) ) and ready to be copied over to your Xamarin Studio directory so you can snippet the h*ll out of your bright new IDE once more!

The steps to quicken your development quests:

  1. Go to your Monodevelop-{version} directory to find the “Snippets” directory:
    Mac ~/Library/Preferences/MonoDevelop-{version}/
    Windows Vista/7 ~/AppData/Roaming/MonoDevelop-{version}/Config
    Linux ~/.config/MonoDevelop-{version}/
  2. Copy the Snippets directory
  3. Paste it under your Xamarin Studio-4.0 directory:
    Mac ~/Library/Preferences/XamarinStudio-4.0/
    Windows Vista/7 ~/AppData/Roaming/XamarinStudio-4.0/Config
    Linux ~/.config/XamarinStudio-4.0/
  4. If you have Xamarin Studio open, close it and restart to see the snippets in your preferences screen once again.
  5. Happy coding!

One tip: you can also find Keybindings, Policies and Highlighting schemes in the same dir too. Maybe copy your preferred versions along too. DO THIS AT YOUR OWN RISK THOUGH! Snippets are harmless (unless you override good ones with crappy ones 😉 ).