问题
Consider that there are different programming languages and different IDE.
Some IDE is possible to use for many languages, almost all Text Editor possible use with any programming language. There also many operation systems.
And we have code snippets.
We want write it once, use it anywhere. We don't want to be bound to any language, tool or platform.
What format use to store code snippets ?
Personally at this moment I store all snippets as files in single folder located in Dropbox. Files have descriptive names and ends with extension of programming language. Inside each file there is simply code. It's all searchable using Sublime Text or NVAlt
There are similar questions: OS/IDE-agnostic method of storing snippets, https://stackoverflow.com/questions/212634/best-application-for-storing-code-snippets?lq=1, Recommended online snippet manager, How do I index and make available reusable code?
回答1:
You can use Snippets. It is available as a native apps for Mac and Windows, supports sync natively and they are free.
Recently we introduced a feature called Distributors. It allows you to re-use code snippets from Snippets in your IDE or code editor natively. Here is the list of currently supported IDEs and we are adding more IDEs to the list.
来源:https://stackoverflow.com/questions/17444182/what-format-use-to-store-code-snippets-with-cross-platform-compatibility-in-mind