intellij-postfix-templates icon indicating copy to clipboard operation
intellij-postfix-templates copied to clipboard

Settings storage location

Open natros opened this issue 7 years ago • 2 comments

Hello.

If I'm not mistaken, all plugins and the Intellij store the settings in Library/Preferences/IntelliJIdea2017.3. Is there any known reason to be stored in Library/Application Support/IntelliJIdea2017.3/custom-postfix-templates/templates?

Is it possible to integrate with IDE Settings Sync?

natros avatar Dec 06 '17 21:12 natros

Hi natros. That's interesting. I didn't know that the path is different on Macs. I tested it only on Linux system and there the templates are stored in ~/.IntelliJIdea2017.3/config/plugins/custom-postfix-templates/templates which means it's part of the "config" directory and therefore also automatically copied to the config of next IDEA releases.

I never tried IDE sync, so I don't know how it works and if non-xml-files are synchronized at all. The problem with the template files is that they do not really fit into the preferences concept of IDEA. In the beginning I actually used the preferences API to store the templates. So they were embedded in one of the xml configuration files. The drawback was that I could only use a small subset of IDEA's functionality to edit the templates (e.g. no code completion, no error highlighting). Those functions require a real, file based editor tab in IDEA. So I decided to work around the official preferences API and searched for a way to store the templates in an appropriate directory within the "config" dir. I thought I've found it with the one described above, but if you discover those problems I have to search further. I probably have to ask someone how to get the directory where IDEA saves the preferences/config, since this API is (if available) very hidden.

xylo avatar Dec 07 '17 08:12 xylo

Hi,

On the Mac, the Library/Preferences/IntelliJIdea2017.3/templates and Library/Application Support/IntelliJIdea2017.3 are also copied automatically whenever a major version is released.

If you change any of the IDE native live templates, they are copied to Library/Preferences/IntelliJIdea2017.3/templates. The same is true for file templates (Library/Preferences/IntelliJIdea2017.3/fileTemplates).

IDE sync is new (https://plugins.jetbrains.com/plugin/9922-ide-settings-sync), bu what I usually do is to store some settings from Library/Preferences/IntelliJIdea2017.3/ in a git repo to share settings between work and home.

You can always ask in the dedicated forum to plugins (https://intellij-support.jetbrains.com/hc/en-us/community/topics/200366979-IntelliJ-IDEA-Open-API-and-Plugin-Development)

As a final note, thank you for this excellent plugin.

natros avatar Dec 07 '17 16:12 natros