Sharing PyCharm Settings
It is quite possible that you use one PyCharm license on different machines and on the different operating systems, for example, on your desktop at work and on your laptop at home. Another option is to share settings across a team, so that all the teammates use the same code style, live templates, or file templates. That's why it is vital to be able to share PyCharm settings, which is done by means of export and import.
PyCharm provides Export Settings command that produces the archive
settings.jar. This archive contains the global settings differing from the defaults, and is stored locally. If you want to share your global settings, you have to make this archive accessible. You can do this in the numerous ways:
- Put this archive under version control
- Place it in your Dropbox
- Just write it to a flash drive and stick into your pocket.
As soon as the archive of the global settings becomes accessible, it can be imported into another installation of PyCharm using the Import Settings command.
What this tutorial is about
This tutorial aims to walk you through exporting PyCharm global settings, sharing them via VCS, and importing them to a different PyCharm installation.
Out of scope of this tutorial are:
- Python programming
- Information about the project and IDE settings.
- Information about using specific version control tools, Dropbox etc.
Before you start
Make sure that you are working with PyCharm. This tutorial is created with PyCharm version 2017.1.
Preparing an example
- First, we'll change some settings (for example, code style, keymap, and editor color scheme). This step is required, because we are going to export the archive of global settings, that contains only the differences against the default settings.
- Next, we'll see where the copies of the schemes reside. This step is optional, and is intended just for your information.
- Finally, we'll put the project under version control. This step can also be considered optional, since, as mentioned above, you can make your archive of global settings accessible in numerous ways.
Creating copies of the various schemes
We are going to create copies of the various schemes (remember, the pre-defined schemes are not editable) to further change and share them. Click on the main toolbar to open the Settings/Preferences dialog.
Creating a copy of the code style scheme
Follow these steps:
- On the Code Style page of the editor settings, click Manage.
- Then, in the Code Style Schemes dialog, select a scheme you want to copy, click the button Save As, and type the new scheme name:
Creating a copy of a keymap
In the Keymap page of the Settings/Preferences dialog, choose a scheme and click Copy:
Where the copies of the setting are stored?
Storage location of the settings depends on your platform. For example, for Windows, the settings are stored in your user home, so it makes sense to look for the copies of the schemes there. Here they are, under the
The copies of the new schemes are added to the global settings, and as such, become sharable:
Putting the project under version control
In this example, we use PyCharm's Git integration. It is supposed that you have Git integration enabled.
To put the project under version control, click on the main toolbar to open the Settings/Preferences dialog, then on the Version Control page click to add a new content root, and choose Git as the version control system:
Refer to the section Associating a Directory with a Specific Version Control System .
Let's export the settings. To do that, on the main menu, click Export Settings dialog, click the ellipsis to choose the target location. Since we want to use the PyCharm's Git integration, it makes sense to place the exported archive under the project root, to make the archive visible in the Project Tool Window, and make use of the Version Control Tool Window. Next, unselect the checkboxes to the left of the unnecessary settings, and then click OK:, and then, in the
settings.jar archive is created in the specified location. Since we have chosen the project root, we see this archive (marked as unversioned file) in the Project tool window, and in the Version Control tool window.
Actually, export is done... the only thing left is to push the archive to the repository. So first, press Ctrl+Alt+A to add the new file to version control, and commit changes:
What's next? Let us suppose that your teammates have access to your repository and can download your settings archive. Then one has to choosein his/her PyCharm installation, and locate the downloaded archive (or its parent directory):
Next, one has to specify which settings should be imported - one can actually unselect, for example, keymap settings, if he/she is quite happy with his/her keymap:
After clicking OK, PyCharm suggests to restart, for the new schemes to take effect.
You may find it useful to read PyCharm documentation. Refer to the page Exporting and Importing Settings .