Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which IntelliJ config files should I save in my dotfiles?

I would like to keep my IntelliJ config files in my dotfiles repo but my ~/.IntelliJIdea2016.1 folder weights > 1.3G :(

~/.IntelliJIdea2016.1/config/ still weights > 215M...

~/.IntelliJIdea2016.1/config/plugins/ contains lots of binaries... not the best candidates for dotfiles :(

Anyone tried to save IntelliJ config without Export/Import settings menu option?

like image 979
Cedric Thiebault Avatar asked Jun 12 '16 16:06

Cedric Thiebault


People also ask

What is .idea folder in IntelliJ?

The . idea folder (hidden on OS X) in the solution root contains IntelliJ's project specific settings files. These include per-project details such as VCS mapping and run and debug configurations, as well as per-user details, such as currently open files, navigation history and currently selected configuration.

How do I import settings into IntelliJ?

Import settings from a ZIP archiveCall File | Manage IDE Settings | Import Settings from the main menu. Select the ZIP archive that contains your settings in the dialog that opens. Select the settings you want to apply in the Select Components to Import dialog that opens and click OK.

Where are IntelliJ logs stored?

IntelliJIdea13 folder on the home directory. (For the Android adaptation it could also be in . AndroidStudioX.


3 Answers

No need to store IntelliJ config file, just use IDE Settings Sync plugin.

See this post: Better Synchronization of your Settings Across Devices

like image 62
Cedric Thiebault Avatar answered Sep 22 '22 05:09

Cedric Thiebault


You can either 'Share settings through a settings repository' or you can 'Share your settings with the Settings Sync plugin'.

More details can be found at https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html. If the link ever expires please let me know in the comments below.

like image 42
David Avatar answered Sep 21 '22 05:09

David


Sadly, it's not simple. The user configuration folders are not well-documented and have historically included a bunch of default junk, which is slowly being stripped out (see https://youtrack.jetbrains.com/issue/IDEA-128660 and https://youtrack.jetbrains.com/issue/IDEA-163616). The documentation of settings files is also very poor; my request for improvement was declined https://youtrack.jetbrains.com/issue/IDEA-154157).

I version control my settings. If you request access, you can see it at https://gitlab.com/jcrben-staples/dotfiles-group/dotfiles/tree/master/config/intellij-idea-latest with notes at https://gitlab.com/jcrben-staples/dotfiles-group/dotfiles/tree/master/config/intellij-idea-latest/MY_CONFIG_DOCS.md).

I set up my .gitignore to ignore everything by default, and then I whitelist the files that I want. With IntelliJ, I didn't know where to start, so I whitelisted the entire folder and then blacklisted a bunch of the files.

My blacklist doesn't exactly answer your question about what files to include, but it does give you an idea of what to exclude. I'll try to update this if I figure out which ones to include at some point, but it's a mishmash of plugin files and such.

Right now the blacklist looks something like this:

    # 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

This leaves fair number of files which are not blacklisted - plus I symlink my .idea files sometimes and version control those settings, although workspace.xml has a lot of stuff and it changes all the time (see https://youtrack.jetbrains.com/issue/IDEA-163348).

Also, keep your eye out for "Share" buttons like the one shown for a scope below, as these seem to control whether the setting is shared to a configuration.

enter image description here

The most elegant set up for settings configuration comes from VSCode - hopefully at some point Jetbrains will figure this out and copy them:

enter image description here

like image 22
Ben Creasy Avatar answered Sep 18 '22 05:09

Ben Creasy