Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexRogalskiy/1e4a0785ac93b581069a6e654cf6aee0 to your computer and use it in GitHub Desktop.
Save AlexRogalskiy/1e4a0785ac93b581069a6e654cf6aee0 to your computer and use it in GitHub Desktop.
JetBrains change location of config and system directories

Intro

Normally the Jetbrains applications store their config and system in a directory in your home directory. That's fine except when you run out of space in your home directory, or they change the directory with an upgrade. For example, when you upgrade PhpStorm from 2016.3 to 2017.1, the config directory and systems directory changes as well. This means that 2017.1 doesn't have the plugins you installed with 2016.3

Somewhere buried deep in the knowledge base is an article that explains how you can fix this but putting it out here makes it easier to find.

Instructions

These instructions are written for Ubuntu, if you run another distro the locations and files might be different.

I'm assuming you config and system directory will be stored in /d1/config/{JetBrains App}/

The following part is an example for PhpStorm

  • Create a directory for new config and system directories /d1/config/PhpStorm
  • Copy the config and system directories from the {HOME}/.PhpStorm2017.1 directory to their new locations
  • Copy the file idea.properties from the PhpStorm bin directory to /d1/config/PhpStorm
  • Edit the idea.properties file as shown in the file idea.properties in this gist. You only need to edit the lines 8, 13, 18, and 23

Let JetBrains obey the new idea.properties files

  • Create a file jetbrains.sh in the directory /etc/profile.d/
  • Add the necessary parts for the programs you run. (See the file jetbrains.sh in this gist)
  • Restart your computer. Unfortunately you have to restart your computer after editing the jetbrains.sh file.
# Use ${idea.home.path} macro to specify location relative to IDE installation home.
# Use ${xxx} where xxx is any Java property (including defined in previous lines of this file) to refer to its value.
# Note for Windows users: please make sure you're using forward slashes (e.g. c:/idea/system).
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.config.path=/d1/config/PhpStorm/config
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.system.path=/d1/config/PhpStorm/system
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.plugins.path=${idea.config.path}/plugins
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.log.path=${idea.system.path}/log
#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500
#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE is able to open.
#---------------------------------------------------------------------
idea.max.content.load.filesize=20000
#---------------------------------------------------------------------
# This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb).
# Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled
#---------------------------------------------------------------------
idea.cycle.buffer.size=1024
#---------------------------------------------------------------------
# Configure if a special launcher should be used when running processes from within IDE.
# Using Launcher enables "soft exit" and "thread dump" features
#---------------------------------------------------------------------
idea.no.launcher=false
#---------------------------------------------------------------------
# To avoid too long classpath
#---------------------------------------------------------------------
idea.dynamic.classpath=false
#---------------------------------------------------------------------
# Uncomment this property to prevent IDE from throwing ProcessCanceledException when user activity
# detected. This option is only useful for plugin developers, while debugging PSI related activities
# performed in background error analysis thread.
# DO NOT UNCOMMENT THIS UNLESS YOU'RE DEBUGGING IDE ITSELF. Significant slowdowns and lockups will happen otherwise.
#---------------------------------------------------------------------
#idea.ProcessCanceledException=disabled
#---------------------------------------------------------------------
# There are two possible values of idea.popup.weight property: "heavy" and "medium".
# If you have WM configured as "Focus follows mouse with Auto Raise" then you have to
# set this property to "medium". It prevents problems with popup menus on some
# configurations.
#---------------------------------------------------------------------
idea.popup.weight=heavy
#---------------------------------------------------------------------
# Disabling this property may lead to visual glitches like blinking and fail to repaint
# on certain display adapter cards.
#---------------------------------------------------------------------
sun.java2d.noddraw=true
#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under Windows.
#---------------------------------------------------------------------
sun.java2d.d3d=false
#---------------------------------------------------------------------
# Set swing.bufferPerWindow=false to workaround a slow scrolling in JDK6 (see IDEA-35883),
# But this may lead to performance degradation in JDK8, because it disables a double buffering,
# which is needed to eliminate tearing on blit-accelerated scrolling and to restore
# a frame buffer content without the usual repainting, even when the EDT is blocked.
#---------------------------------------------------------------------
swing.bufferPerWindow=true
#---------------------------------------------------------------------
# Removing this property may lead to editor performance degradation under X Window.
#---------------------------------------------------------------------
sun.java2d.pmoffscreen=false
#---------------------------------------------------------------------
# Enables HiDPI support in JBRE
#---------------------------------------------------------------------
sun.java2d.uiScale.enabled=false
#---------------------------------------------------------------------
# Workaround to avoid long hangs while accessing clipboard under Mac OS X.
#---------------------------------------------------------------------
#ide.mac.useNativeClipboard=True
#---------------------------------------------------------------------
# Maximum size (kilobytes) IDEA will load for showing past file contents -
# in Show Diff or when calculating Digest Diff
#---------------------------------------------------------------------
#idea.max.vcs.loaded.size.kb=20480
#---------------------------------------------------------------------
# IDEA file chooser peeks inside directories to detect whether they contain a valid project
# (to mark such directories with a corresponding icon).
# Uncommenting the option prevents this behavior outside of user home directory.
#---------------------------------------------------------------------
#idea.chooser.lookup.for.project.dirs=false
#-----------------------------------------------------------------------
# Experimental option that does a number of things to make truly smooth scrolling possible:
#
# * Enables hardware-accelerated scrolling.
# Blit-acceleration copies as much of the rendered area as possible and then repaints only newly exposed region.
# This helps to improve scrolling performance and to reduce CPU usage (especially if drawing is compute-intensive).
#
# * Enables "true double buffering".
# True double buffering is needed to eliminate tearing on blit-accelerated scrolling and to restore
# frame buffer content without the usual repainting, even when the EDT is blocked.
#
# * Adds "idea.true.smooth.scrolling.debug" option.
# Checks whether blit-accelerated scrolling is feasible, and if so, checks whether true double buffering is available.
#
# * Enables handling of high-precision mouse wheel events.
# Although Java 7 introduced MouseWheelEven.getPreciseWheelRotation() method, JScrollPane doesn't use it so far.
# Depends on the Editor / General / Smooth Scrolling setting, remote desktop detection and power save mode state.
# Ideally, we need to patch the runtime (on Windows, Linux and Mac OS) to improve handling of the fine-grained input data.
# This feature can be toggled via "idea.true.smooth.scrolling.high.precision" option.
#
# * Enables handling of pixel-perfect scrolling events.
# Currently this mode is available only under Mac OS with JetBrains Runtime.
# This feature can be toggled via "idea.true.smooth.scrolling.pixel.perfect" option.
#
# * Enables interpolation of scrolling input (scrollbar, mouse wheel, touchpad, keys, etc).
# Smooths input which lacks both spatial and temporal resolution, performs the rendering asynchronously.
# Depends on the Editor / General / Smooth Scrolling setting, remote desktop detection and power save mode state.
# The feature can be tweaked using the following options:
# "idea.true.smooth.scrolling.interpolation" - the main switch
# "idea.true.smooth.scrolling.interpolation.scrollbar" - scrollbar interpolation
# "idea.true.smooth.scrolling.interpolation.scrollbar.delay" - initial delay for scrollbar interpolation (ms)
# "idea.true.smooth.scrolling.interpolation.mouse.wheel" - mouse wheel / touchpad interpolation
# "idea.true.smooth.scrolling.interpolation.mouse.wheel.delay.min" - minimum initial delay for mouse wheel interpolation (ms)
# "idea.true.smooth.scrolling.interpolation.mouse.wheel.delay.max" - maximum initial delay for mouse wheel interpolation (ms)
# "idea.true.smooth.scrolling.interpolation.precision.touchpad" - precision touchpad interpolation
# "idea.true.smooth.scrolling.interpolation.precision.touchpad.delay" - initial delay for precision touchpad interpolation (ms)
# "idea.true.smooth.scrolling.interpolation.other" - interpolation of other input sources
# "idea.true.smooth.scrolling.interpolation.other.delay" - initial delay for other input source interpolation (ms)
#
# * Adds on-demand horizontal scrollbar in editor.
# The horizontal scrollbar is shown only when it's actually needed for currently visible content.
# This helps to save editor space and to prevent occasional horizontal "jitter" on vertical touchpad scrolling.
# This feature can be toggled via "idea.true.smooth.scrolling.dynamic.scrollbars" option.
#-----------------------------------------------------------------------
#idea.true.smooth.scrolling=true
#---------------------------------------------------------------------
# IDE can copy library .jar files to prevent their locking. Set this property to 'false' to enable copying.
#---------------------------------------------------------------------
idea.jars.nocopy=true
#-----------------------------------------------------------------------
# Change to 'enabled' if you want to receive instant visual notifications
# about fatal errors that happen to an IDE or plugins installed.
#-----------------------------------------------------------------------
idea.fatal.error.notification=disabled
# IntelliJ IDEA
IDEA_PROPERTIES=/d1/config/IntelliJIdea/idea.properties
export IDEA_PROPERTIES
# PyCharm
PYCHARM_PROPERTIES=/d1/config/PyCharm/idea.properties
export PYCHARM_PROPERTIES
# Gogland
GOGLAND_PROPERTIES=/d1/config/Gogland/idea.properties
export GOGLAND_PROPERTIES
# PhpStorm
PHPSTORM_PROPERTIES=/d1/config/PhpStorm/idea.properties
export PHPSTORM_PROPERTIES
# WebStorm
WEBIDE_PROPERTIES=/d1/config/WebStorm/idea.properties
export WEBIDE_PROPERTIES
# RubyMine
RUBYMINE_PROPERTIES=/d1/config/RubyMine/idea.properties
export RUBYMINE_PROPERTIES
# DataGrip
DATAGRIP_PROPERTIES=/d1/config/DataGrip/idea.properties
export DATAGRIP_PROPERTIES
# CLion
CL_PROPERTIES=/d1/config/CLion/idea.properties
export CL_PROPERTIES
# Rider
RIDER_PROPERTIES=/d1/config/CLion/idea.properties
export RIDER_PROPERTIES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment