This is my global configuration for PhpStorm, my favorite 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 are based on PSR-1 and 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 2018.2.
Language | Standards |
---|---|
PHP | PSR-2, PSR-12 |
HTML / Twig | 4 spaces |
CSS / SCSS / LESS | 4 spaces |
JAVASCRIPT | 4 spaces |
BLADE | 4 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 ~/.PhpStorm2018.2/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:m-abdullahi/idea-configurations-repository.git
git fetch
git checkout -t origin/master
OS | Location |
---|---|
Windows | C:\Users\<User name>\.PhpStorm2018.2\config |
Linux | ~/.PhpStorm2018.2/config |
OS X | ~/Library/Preferences/PhpStorm2018.2 |
See Default IDE directories for more information about the location of the configuration directory.
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 (Keymap) |
templates | Live templates (Editor > Live Templates) |