【问题标题】:Which IntelliJ config files should I save in my dotfiles?我应该将哪些 IntelliJ 配置文件保存在我的点文件中?
【发布时间】:2016-06-12 16:39:48
【问题描述】:

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

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

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

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

【问题讨论】:

标签: intellij-idea dotfiles


【解决方案1】:

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

看到这个帖子:Better Synchronization of your Settings Across Devices

【讨论】:

  • 这不会包括版本历史,对吗?
  • 不,不会:-(
【解决方案2】:

遗憾的是,这并不简单。用户配置文件夹没有很好的文档记录,并且历史上包含一堆默认垃圾,这些垃圾正在慢慢被剥离(参见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) .

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

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

【讨论】:

    【解决方案3】:

    您可以“通过设置存储库共享设置”或“使用设置同步插件共享设置”。

    更多详情请访问https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html。如果链接过期,请在下面的 cmets 中告诉我。

    【讨论】:

      猜你喜欢
      • 2020-02-20
      • 2023-03-25
      • 2021-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-18
      • 1970-01-01
      • 2019-04-18
      相关资源
      最近更新 更多