This is my global configuration for PhpStorm. PhpStorm is an IDE for PHP. I have some custom configuration for code styling, inspections and file templates, and I use Git to track these configuration files and to synchronize them between workstations. The code style rules follow PSR-2 but I also added some things that are not specified in the PSR guidelines.
Feel free to use or fork this repository. Note that I use PhpStorm 2016.1. I cannot guarantee compatibility with other versions of PhpStorm.
Language | Settings |
---|---|
PHP | PSR-2, Symfony Coding Standards |
HTML / Twig | 4 spaces |
CSS / SCSS / LESS | 2 spaces |
Yaml | 2 spaces |
Before you do this, make sure PhpStorm is not running, or it will overwrite the changed files before shutting down.
Use the following commands to go to the config directory, remove some default directories, and pull the files from my repository:
# replace with the actual directory name, depending on OS and PhpStorm version (see below).
cd ~/.PhpStorm2016.1/config
# remove the files and folders that are in this repository
rm -r codestyles/
rm -r fileTemplates/
rm -r inspection/
git init
git remote add origin git@github.com:nicwortel/phpstorm-ide-config.git
git fetch
git checkout -t origin/master
OS | Location |
---|---|
Windows XP | C:\Documents and Settings\<User name>\.PhpStorm2016.1\config |
Windows Vista | C:\Users\<User name>\.PhpStorm2016.1\config |
Linux | ~/.PhpStorm2016.1/config |
OS X | ~/Library/Preferences/PhpStorm2016.1 |
Before PhpStorm 2016.1, configuration was stored in a different directory. This was .WebIde100 for PhpStorm 10, .WebIde90 for PhpStorm 9, etc. See Project and IDE settings for more information about the configuration directory structure.
Directory | Contents |
---|---|
codestyles | Code Style settings (Editor > Code Style) |
colors | Colors & Fonts settings (Editor > Colors & Fonts) |
fileTemplates | File and Code Templates (Editor > File and Code Templates) |
filetypes | File Types (Editor > File Types) |
inspection | Inspection profiles (Editor > Inspections) |
keymaps | Keyboard shortcuts (Appearance & Behavior > Keymap) |
templates | Live templates (Editor > Live Templates) |