Home  >  Article  >  Development Tools  >  How to use phpstorm to save (ctrl+s) and format the code at the same time

How to use phpstorm to save (ctrl+s) and format the code at the same time

藏色散人
藏色散人forward
2020-12-10 15:05:402492browse

The following tutorial column of phpstorm will introduce to you how phpstorm can save (ctrl s) and format the code at the same time. I hope it will be helpful to friends in need!

How to use phpstorm to save (ctrl+s) and format the code at the same time

##1. Select Edit->Macros->Start Macro Recording, as shown below:

How to use phpstorm to save (ctrl+s) and format the code at the same time

2. Directly press the shortcut key you want to record, Ctrl ALT L, Ctrl S, and then click the little red dot in the picture below.

How to use phpstorm to save (ctrl+s) and format the code at the same time

3. Then enter Format And Save (you can enter the name at will, as long as you can remember it)

How to use phpstorm to save (ctrl+s) and format the code at the same time

4. In File->Settings->Keymap->Macros, find the "Format And Save" you just added, right-click "add keyboard shortcut", enter the shortcut key "Ctrl S", and click "OK" . At this point, the automatic formatting of code saving (Ctrl S) is completed. Go and try it now.

How to use phpstorm to save (ctrl+s) and format the code at the same time

Note: If it is a Chinese version of phpstorm, some will not be able to enter "Settings". Please find the language resource package (installation directory, under lib) and temporarily restore it to the English package. , restart phpstorm, enter the settings, and after the modification is successful, restore it to Chinese.

How to use phpstorm to save (ctrl+s) and format the code at the same time

The above is the detailed content of How to use phpstorm to save (ctrl+s) and format the code at the same time. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete