Book Image

PhpStorm Cookbook

By : Mukund Chaudhary
Book Image

PhpStorm Cookbook

By: Mukund Chaudhary

Overview of this book

Table of Contents (16 chapters)
PhpStorm Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a key binding


For all those people who find key bindings difficult to visualize, key bindings mean keyboard shortcuts, and they are the gear changers in a programmer's life. When you are concentrating hard on the project that you have to complete within a stipulated amount of time, you can bet anything in this world for a way or a means by which your speed of working gets affected positively. Bet on keyboard shortcuts. You will be on the winning side.

PhpStorm, again, specifies some default keymap shortcuts. Don't worry friends! You can very easily customize the keyboard shortcuts to suit your taste.

How to do it...

  1. Use the keyboard shortcut Ctrl + Alt + S or choose from the File menu.

  2. Go to the Settings dialog box and type keymap in the search box provided at the top and PhpStorm will highlight the target for you.

  3. Choose from a list of the default keymap settings, as shown in the following screenshot, but better late than never. Before jumping to change the shortcuts, understand how shortcuts work in PhpStorm. The keymap shortcuts provided by PhpStorm by default are not directly editable, so in order to customize them, you need to make a copy of the default settings. Sounds confusing? The PhpStorm wizard creates the copy for you. Your mind prompts a question—where are my settings saved then? Here comes the answer—under *nix based systems.

How it works...

PhpStorm uses the directory ~/.WebIde70/config/keymaps to store all the keymap schemes that you create. Still not feeling confident? Here are the tricks of the trade.

PhpStorm will copy it for you. It will ask you for a name for this keymap scheme. The name you specify will be respected by PhpStorm. A careful observation would easily tell you that PhpStorm will always make you remember that your current selection is based on the setting provided by PhpStorm. After you have made the selection to copy and modify, all you have to do is to press the Apply button. Bingo! You just created a copy of one default setting, and now you are all set to customize PhpStorm behavior your own way.

To verify that, you can go to ~/.WebIde70/config/keymaps and see that PhpStorm just created a new XML file for you that contains the settings you created via the PhpStorm GUI. Behind every successful frontend, there is an equally strong backend!

Tip

If you think that you can speak XML, you can create some settings via the GUI and then view the contents of the XML file to observe how the settings are saved. You can later add items directly to the XML file. You naughty hacker! Control your smile!