我应该在我的dotfiles中保存哪些IntelliJ配置文件?

时间:2016-06-12 16:39:49

标签: intellij-idea dotfiles

我想将IntelliJ配置文件保存在我的dotfiles repo中,但我的~/.IntelliJIdea2016.1文件夹权重> 1.3G :(

~/.IntelliJIdea2016.1/config/仍然权重> 215M ...

~/.IntelliJIdea2016.1/config/plugins/包含许多二进制文件......不是dotfiles的最佳候选者:(

有人试图在没有Export/Import settings菜单选项的情况下保存IntelliJ配置吗?

3 个答案:

答案 0 :(得分:1)

无需存储IntelliJ配置文件,只需使用即可 IDE Settings Sync插件。

请参阅此帖子:Better Synchronization of your Settings Across Devices

答案 1 :(得分:0)

可悲的是,这并不简单。用户配置文件夹没有详细记录,并且历史上包含一堆默认垃圾,这些垃圾正在慢慢被剥离(请参阅https://youtrack.jetbrains.com/issue/IDEA-128660https://youtrack.jetbrains.com/issue/IDEA-163616)。设置文件的文档也很差;我的改进请求被拒绝https://youtrack.jetbrains.com/issue/IDEA-154157)。

我版本控制我的设置。如果您请求访问权限,则可以在https://gitlab.com/jcrben-staples/dotfiles-group/dotfiles/tree/master/config/intellij-idea-latest上查看,并在https://gitlab.com/jcrben-staples/dotfiles-group/dotfiles/tree/master/config/intellij-idea-latest/MY_CONFIG_DOCS.md处注明。

我将.gitignore设置为默认忽略所有内容,然后将我想要的文件列入白名单。使用IntelliJ,我不知道从哪里开始,因此我将整个文件夹列入白名单,然后将一堆文件列入黑名单。

我的黑名单并未完全回答您关于包含的文件的问题,但它确实可以让您了解要排除的内容。如果我弄清楚哪些要包含在某些方面,我会尝试更新这个,但这是插件文件等的混搭。

现在黑名单看起来像这样:

    # IntelliJ IDEA stuff
    .idea
    !config/intellij-idea-latest/**
    !projects/bi-idea/workspace.xml

    # statistics files
    config/intellij-idea-latest/options/statistics*
    config/intellij-idea-latest/options/feature.usage.statistics.xml
    config/intellij-idea-latest/options/usage.statistics.xml
    config/intellij-idea-latest/options/statistics.application.usages.xml

    # user files ??
    config/intellij-idea-latest/user*

    # other
    config/intellij-idea-latest/options/atlassian-ide-plugin.app.xml
    config/intellij-idea-latest/options/cachedDictionary.xml
    config/intellij-idea-latest/options/customization.xml
    # has my autobracket disable
    config/intellij-idea-latest/options/CodeGlance.xml
    # config/intellij-idea/options/editor.codeinsight.xml
    config/intellij-idea-latest/options/databaseDrivers.xml
    config/intellij-idea-latest/options/debugger.xml
    config/intellij-idea-latest/options/dimensions.xml
    config/intellij-idea-latest/options/extensionsRootType.xml
    config/intellij-idea-latest/options/filetypes.xml
    config/intellij-idea-latest/options/find.xml
    config/intellij-idea-latest/options/find.recents.xml
    config/intellij-idea-latest/options/jdk.table.xml
    config/intellij-idea-latest/options/gemmanager.xml
    config/intellij-idea-latest/options/github_settings.xml
    config/intellij-idea-latest/options/gradle.run.settings.xml
    config/intellij-idea-latest/options/extensionsRootType.xml
    config/intellij-idea-latest/options/hg.xml
    config/intellij-idea-latest/options/ignore.xml
    config/intellij-idea-latest/options/markdown.xml
    config/intellij-idea-latest/options/multimarkdown.local.xml
    config/intellij-idea-latest/options/multimarkdown.shared.xml
    config/intellij-idea-latest/options/options.xml
    config/intellij-idea-latest/options/other.xml
    config/intellij-idea-latest/options/packages.xml
    config/intellij-idea-latest/options/pomodoro.state.xml
    config/intellij-idea-latest/options/project.default.xml
    config/intellij-idea-latest/options/proxy.settings.pwd
    config/intellij-idea-latest/options/recentProjects.xml
    config/intellij-idea-latest/options/recentProjectDirectories.xml
    config/intellij-idea-latest/options/remote-servers.xml
    config/intellij-idea-latest/options/runner.layout.xml
    config/intellij-idea-latest/options/scratches.xml
    config/intellij-idea-latest/options/stubIndex.xml
    config/intellij-idea-latest/options/updates.xml
    config/intellij-idea-latest/options/usageView.xml
    config/intellij-idea-latest/options/vcs.xml
    config/intellij-idea-latest/options/window.manager.xml
    config/intellij-idea-latest/options/window.state.xml

    # turn off those auto-update messages...
    config/intellij-idea-latest/port
    config/intellij-idea-latest/plugins/*
    config/intellij-idea-latest/tasks/*
    config/intellij-idea-latest/extensions/
    config/intellij-idea-latest/jdbc-drivers/*

    # region START UNIGNORE IntelliJ
    !config/intellij-idea-latest/scratches/
    !config/intellij-idea-latest/consoles/
    config/intellij-idea-latest/consoles/.history/*

    # General settings
    # config/intellij-idea-latest/sonarlint/
    config/intellij-idea-latest/javascript/nodejs/**
    # config/intellij-idea-latest/options/editor.codeinsight.xml # has my autobracket disable
    # endregion END UNIGNORE Intellij

这会留下未列入黑名单的相当数量的文件 - 加上我有时会对.idea个文件进行符号链接,版本控制这些设置,尽管workspace.xml有很多内容并且它会一直在变化(请参阅https://youtrack.jetbrains.com/issue/IDEA-163348)。

另外,请注意“共享”按钮,如下面的范围所示,因为这些按钮似乎可以控制设置是否与配置共享。

enter image description here

设置配置最优雅的设置来自VSCode - 希望在某些时候Jetbrains能够解决这个问题并将其复制出来:

enter image description here

答案 2 :(得分:0)

您可以“通过设置存储库共享设置”,也可以“通过Settings Sync插件共享设置”。

更多详细信息,请访问https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html。如果链接过期,请在下面的评论中让我知道。