Shared PhpStorm settings for the Codepress team so we all work with the same configuration and produce the same output across our codebase.
Settings come in two flavours:
- Application settings (Live Templates, Code Inspections) are copied into your PhpStorm configuration directory.
- Project settings (Scopes, File Watchers) live in the project's own
.ideadirectory.
| File | Type | Copy to |
|---|---|---|
templates/PHP.xml, templates/WordPress.xml, templates/JavaScript.xml |
Application | <config>/templates |
inspection/Codepress.xml |
Application | <config>/inspection |
scopes/Admin_Columns_Free.xml, scopes/Admin_Columns_Pro.xml |
Project | <project>/.idea/scopes |
fileWatchers/watcherTasks.xml |
Project | <project>/.idea |
<config> is your PhpStorm configuration directory,
~/Library/Application Support/JetBrains/PhpStorm20xx.x/ (pick the latest PhpStorm20xx.x folder). The
exact path for your install is shown under Help > Edit Custom Properties. <project> is the project
opened in PhpStorm — see the File Watchers note for which directory that must be.
Our custom live templates for PhpStorm, divided into three groups:
- PHP
templates/PHP.xml - WordPress
templates/WordPress.xml - JavaScript
templates/JavaScript.xml
- Copy the
templates/PHP.xml,templates/WordPress.xmlandtemplates/JavaScript.xmlfiles from this repo. - Copy them to your
<config>/templatesdirectory. - Restart PhpStorm.
- The groups are activated by default. Disable any group or live template from PhpStorm Preferences > Editor > Live Templates.
- The abbreviations that trigger each live template are listed under PhpStorm Preferences > Editor > Live Templates.
Our own WordPress code inspections profile for PhpStorm.
- Copy the
inspection/Codepress.xmlfile from this repo. - Copy it to your
<config>/inspectiondirectory. - Activate the profile by selecting 'Codepress' under PhpStorm Preferences > Editor > Inspections.
Shared project scopes for the Admin Columns codebase. They let PhpStorm target the free core and the Pro
plugin separately (excluding vendor, tools and build directories) and are used by the File Watchers
below to run the correct php-cs-fixer config per scope.
- Admin Columns Free
scopes/Admin_Columns_Free.xml - Admin Columns Pro
scopes/Admin_Columns_Pro.xml
Scopes are project settings and live in the project's .idea directory.
- Copy the
scopes/Admin_Columns_Free.xmlandscopes/Admin_Columns_Pro.xmlfiles from this repo. - Copy them to your project's
.idea/scopesdirectory. - Restart PhpStorm.
- The scopes 'Admin Columns Free' and 'Admin Columns Pro' are now available under PhpStorm Preferences > Appearance & Behavior > Scopes.
Shared File Watchers that run php-cs-fixer on save so the whole team produces the same formatting
output. There are two watchers, each scoped to its plugin (see Scopes above):
php-cs-fixer (Pro)runs against the Pro.php-cs-fixer.dist.phpconfig for the 'Admin Columns Pro' scope.php-cs-fixer (Free)runs against the free core.php-cs-fixer.dist.phpconfig for the 'Admin Columns Free' scope.
Like the scopes, File Watchers are project settings and live in the project's .idea directory.
- Import the Scopes first — the watchers reference them by name.
- Copy the
fileWatchers/watcherTasks.xmlfile from this repo. - Copy it to your project's
.ideadirectory (replacing the existingwatcherTasks.xml). - Restart PhpStorm.
- The watchers appear under PhpStorm Preferences > Tools > File Watchers.
Project root: the watcher paths resolve
$ProjectFileDir$/admin-columns-pro/…, so they only work when the directory opened in PhpStorm is the parent folder that containsadmin-columns-pro/— not the plugin folder itself. If you open the plugin directly as the project, the watchers will not find thephp-cs-fixerconfigs.
PHP binary: the watchers call PHP at
/opt/homebrew/opt/php@8.3/bin/php(Homebrew on Apple Silicon). Adjust theprogrampath inwatcherTasks.xmlto match your local PHP 8.3 binary if it differs.
-
Clone the repo.
-
Symlink the application setting you want to edit into the matching PhpStorm directory so changes are picked up live (this works for
templatesandinspection; project settings live in the project's.ideaand are copied, not symlinked):$ cd <config>/<directory> $ ln -s /<path_to_repo>/<directory>/<filename>.xml -
Restart PhpStorm.
-
Make changes, submit pull requests etc.
Manually copying files works, but PhpStorm has built-in ways to share configuration that may suit the team better:
- Settings Sync (
File > Manage IDE Settings > Settings Sync) syncs application settings across your own machines via your JetBrains account. - Settings Repository (
File > Manage IDE Settings > Settings Repository) syncs application settings from a shared Git repository — closest to what this repo does, but automated. - Import / Export Settings (
File > Manage IDE Settings > Import Settings) imports a settings.zip. - Commit project settings to the project repo. The Scopes and File Watchers are plain
.ideafiles; committing them directly into the Admin Columns repo removes the manual copy step for everyone.