Phpstorm Cheat Sheet



PhpStorm has keyboard shortcuts for most of its commands related to editing, navigation, refactoring, debugging, and other tasks. Memorizing these hotkeys can help you stay more productive by keeping your hands on the keyboard.

If your keyboard does not have an English layout, PhpStorm may not detect all of the shortcuts correctly.

The following table lists some of the most useful shortcuts to learn:

Phpstorm

Vagrant and PHPStorm We published a Vagrant Setup that provides you with a basic Ubuntu 16.04 that contains everything that you needed to develop with Shopware. It contains the Apache2 Web Server, MySQL Server as well as all required tools, like ant, curl and git. PHPStorm Cheat Sheet. Show intention actions and quick-fixes. Parameter info (within method call arguments). PhpStorm has a wealth of various language plugins. I, for one, make heavy use of the Dart plugin for PhpStorm. This isn’t the type of plugin I’d like to talk about, though – there’s a. PhpStorm Shortcut Cheatsheet There is also an action to 'clear all tabs' and to 'clear all unedited tabs' that I use a lot, but it's not defined by default. I find assigning them to a hotkey definitely saves time in clearing your workspace (I used Ctrl + Shift + Backspace and Ctrl + Alt + Backspace, respectively). DRAFT: PhpStorm Cheat Sheet. 1 Page (0) DRAFT: PHPStorm Shortcuts Cheat Sheet. A cheat sheet of keyboard shortcuts that I've set up for my person PHPStorm program. 1 Page (0) DRAFT: PHP Storm Setup Keyboard Shortcuts.

ShortcutAction
Double Shift

Quickly find any file, action, class, symbol, tool window, or setting in PhpStorm, in your project, and in the current Git repository.

Ctrl+Shift+A

Find a command and execute it, open a tool window, or search for a setting.

Alt+Enter

Quick-fixes for highlighted errors and warnings, intention actions for improving and optimizing your code.

F2
Shift+F2

Jump to the next or previous highlighted error.

Ctrl+E

Select a recently opened file from the list.

Ctrl+W
Ctrl+Shift+W

Increase or decrease the scope of selection according to specific code constructs.

Ctrl+/
Ctrl+Shift+/

Comment out a line or block of code.

Alt+F7

Show all places where a code element is used across your project.

If you are using one of the predefined keymaps for your OS, you can print the default keymap reference card and keep it on your desk to consult it if necessary. This cheat sheet is also available under Help | Keymap Reference.

Choose the right keymap

To view the keymap configuration, open the Settings/Preferences dialog Ctrl+Alt+S and select Keymap.

Enable function keys and check for possible conflicts with global OS shortcuts.

  • Use a predefined keymap

    PhpStorm automatically suggests a predefined keymap based on your environment. Make sure that it matches the OS you are using or select the one that matches shortcuts from another IDE or editor you are used to (for example, Eclipse or NetBeans ).

  • Tune your keymap

    You can modify a copy of any predefined keymap to assign your own shortcuts for commands that you use frequently.

  • Import custom keymap

    If you have a customized keymap that you are used to, you can transfer it to your installation.

Besides the default set of keymaps, you can add more as plugins (such as, keymaps for GNOME and KDE): open the Settings/Preferences dialog Ctrl+Alt+S, select Plugins and search for keymap in the Marketplace.

If your keymap stopped working after an update, it is likely that the keymap is not available by default in the new version of PhpStorm. Find this keymap as a plugin and install it on the Plugins page as described in Manage plugins.

Learn shortcuts as you work

PhpStorm provides several possibilities to learn shortcuts:

  • Find Action is the most important command that enables you to search for commands and settings across all menus and tools.

    Press Ctrl+Shift+A and start typing to get a list of suggested actions. Then select the necessary action and press Enter to execute it.

  • Key Promoter X is a plugin that shows a popup notification with the corresponding keyboard shortcut whenever a command is executed using the mouse. It also suggests creating a shortcut for commands that are executed frequently.

  • If you are using one of the predefined keymaps for your OS, you can print the default keymap reference card and keep it on your desk to consult it if necessary. This cheat sheet is also available under Help | Keymap Reference.

  • To print a non-default or customized keymap, use the Keymap exporter plugin.

If an action has a keyboard shortcut associated with it, the shortcut is displayed near the name of the action. To add a shortcut for an action that you use frequently (or if you want to change an existing shortcut), select it and press Alt+Enter.

Use advanced features

You can further improve your productivity with the following useful features:

  • Quick Lists

    If there is a group of actions that you often use, create a quick list to access them using a custom shortcut. For example, you can try using the following predefined quick lists:

    • Refactor thisCtrl+Alt+Shift+T

    • VCS OperationsAlt+`

  • PhpStorm provides a lot of typing assistance features, such as automatically adding paired tags and quotes, and detecting CamelHump words.

  • Speed search

    When the focus is on a tool window with a tree, list, or table, start typing to see matching items.

  • Press twice

    Many actions in PhpStorm provide more results when you execute them multiple times. For example, when you invoke basic code completion with Ctrl+Space on a part of a field, parameter, or variable declaration, it suggests names depending on the item type within the current scope. If you invoke it again, it will include classes available through module dependencies. When invoked for the third time in a row, the list of suggestions will include the whole project.

  • Resize tool windows

    You can adjust the size of tool windows without a mouse:

    • To resize a vertical tool window, use Ctrl+Shift+Left and Ctrl+Shift+Right

    • To resize a horizontal tool window, use Ctrl+Shift+Up and Ctrl+Shift+Down

We published a Vagrant Setup that provides you with a basic Ubuntu 16.04 that contains everything that you needed to develop with Shopware.It contains the Apache2 Web Server, MySQL Server as well as all required tools, like ant, curl and git.

Please note that Vagrant setup does not contain a Shopware installation. The installation has to be done manually.

Provisioning

Download the required software:

Additional Information for VirtualBox setup (Windows), or you get errors like 'error downloading the file' without any further explanation:

  • make sure VirtualBox supports 64bit Guest Systems, if only 32 bit is supported check if:
    • your host OS is a 64 bit system
    • Intel Virtualization Technology and VT-d are both(!) enabled
    • the Hyper-V platform is disabled in the Windows Features list

The provisioning is done directly on your new virtual machine by Ansible.

1. Clone the repository to your local machine

2. Boot up your Vagrant virtual machine

The first boot may take a while. After that, your machine will be available at http://192.168.33.10/. All required tools like the LAMP stack are already installed.

  • Adminer (DB-Administration): http://192.168.33.10/adminer.php
  • MySQL user: root, password: shopware

3. SSH access

The SSH username is vagrant, the password: vagrant. To automatically SSH into the created VM run vagrant ssh. If you use Putty, the SSH configuration can be obtained via:

PhpStorm

Benefits of using PhpStorm

  • Intelligent PHP editor
    • PHP code completion
    • Integrated refactoring
    • Smarty and PHPDoc support
  • Easy installation
    • Cross platform
    • Individual project settings
  • Visual PHPUnit test runner
  • VCS support
    • SVN
    • Git
    • Mercurial
    • Local history
  • FTP and remote synchronization
  • Visual debugging inside the IDE
  • HTML5 and CSS editor including zen coding

Install the Shopware Plugin

The official Shopware plugin is available in the global jetbrains repository and can therefore be installed right inside your editor. It depends on the Symfony2 plugin which will automatically be installed during the installation of the Shopware plugin. You can read more about its features on the official plugin page.

Exclude Directories from Indexing

PhpStorm provides you with a variant of automatic code completions. First, PhpStorm needs to index all files inside your Project. This might take a while, depending on the number and size of files in your project.

To exclude directories from indexing, open the Settings and select Directories in the left sidebar. You can now select directories on the right side and mark them as excluded by clicking on Excluded above.

The following directories (if existing) should be excluded:

  • files
  • media
  • recovery
  • snippets
  • var
  • web

These directories will be marked red in your project and might not be visible anymore, but they will still remain on your hard drive.

Coding Style

As mentioned in our CONTRIBUTING.md, you should follow the PSR-1 and PSR-2 coding standards. PhpStorm provides you with predefined settings in Editor -> PHP -> CodeStyling.

Phpstorm cheat sheet download

Deploy with PhpStorm

To deploy a locally installed project to the Vagrant server, you need to configure auto deployment in PhpStorm. Make sure you are using the developer version of Shopware which can be downloaded from GitHub.

git clone https://github.com/shopware/shopware.git

Step 1

Open your Shopware project in PhpStorm.Choose in your toolbar Tools -> Deployment -> Configuration

Step 2

Now we add our new Vagrant machine as deployment target.

Choose a unique name and the 'SFTP' type.

Fill in all required fields.

  • SFTP host: 127.0.0.1
  • Port: 2222
  • Root Path: /home/vagrant/www
  • User name: vagrant
  • Password: vagrant
  • Save Password: yes
  • Web server root URL: http://192.168.33.10/

Now press OK to save your settings.If you configured your deployment machine successfully, you will now be asked to add the RSA key to your known hosts. Press Yes. After that, you should get a success message.

Step 3

After adding your deploy machine, you have to create a mapping between the local and remote files.

Switch to the Mappings directory and press the '...' near Deployment path. Choose /home/vagrant/www/shopware. If the shopware directory doesn't exists, create it here with a right click.

Now press OK and close all deployment windows, so that you are back in your default IDE view.

Right click on your document root directory and click on Upload to Vagrant Deployment

Automatic Upload

You can enable the automatic upload function so you don't have manually upload your files every time you change them: Tools > Deployment > Automatic Upload.

Build Shopware

Now that we uploaded Shopware onto the Vagrant box, we have to configure and install the development edition of Shopware.

1. Connect to your Vagrant Machine

Connect to your Vagrant machine via ssh using the vagrant ssh command

2. Configure your build properties

Input fields:

  • db-host: localhost
  • db name: shopware
  • db username: root
  • db password: shopware
  • app host: 192.168.33.10
  • app path: /shopware

After you get the BUILD SUCCESSFUL message you can run the full build command.

3. Test images

Download the test images and extract them into your Shopware's root directory.

Your Shopware installation is now complete and can be accessed at http://192.168.33.10/shopware.

Phpstorm Cheat Sheet 2020

To open the backend, add /backend to your URL so it becomes http://192.168.33.10/shopware/backend. You can then login using the default user credentials demo/demo.

Phpstorm Cheat Sheet Download

Top