Home >php教程 >PHP开发 >PhpStorm usage notes (2)

PhpStorm usage notes (2)

黄舟
黄舟Original
2016-12-26 10:18:131210browse

Warning: in_array() expects parameter 2 to be array, null given in D:wwwrootipp8wwwrootcontenttemplatesHyPurpleecho_log.php on line 50

Open tab in separate window

When it appears Similar to when you need to compare the code of two tabs, a better way is to separate the two tabs that need to be referenced and edited. For example, put one on the left and one on the right, and then edit the right with reference to the content on the left.

PhpStorm can naturally do this, and there are three different methods of operation.

Method 1: Select the tab you want to open separately with the left mouse button, drag it outside the current editor and release the mouse. The best way Hy369 has tried is to drag the tab to the title bar and release it, so that the drag distance is the closest and can be opened quickly (well, so lazy).

Method 2: When the tab you want to open separately is activated, use the shortcut key Shift + F4 to quickly achieve it.

Method 3: Find the file you want to open separately in the Project toolbar, then hold down the Shift key and double-click the file with the left mouse button to quickly open the file in a separate window.

Special Note: Method 1 is best when the target tab is already open. Method 3 is best when the user’s target tab is not open. The difference between Method 2 and Method 1 is that Method 2 is in a new window. After opening the target tab, the target tab of the original editor will not disappear, but method 1 will. If the target file of method 3 is also opened in the original editor, it will not disappear.

Multiple editor openings

Sometimes you need to open two projects at the same time. If you are prompted for the first time, whether the newly opened project is opened in the current window or newly opened, you choose Remember to choose. In the future, the current window may always be opened, or a new window may always be opened.

If you need to adjust this setting, you can do this:

Open the Setting dialog box and click on Appearance & Behavior -> System Settings. At this point you can see that there is a Project Opening option, and then you can set it.

Open project in new window (Open in a new window)

Open project in the same window (Open in the current window)

Confirm window to open project in (Every time Asking how to open it)

Asterix (*) marks the modified but unsaved document

Generally speaking, marking the modified but unsaved document is A good habit. If you find that your PhpStorm does not do this for you, you can set it like this:

Open the Setting dialog box and click Editor -> General -> Editor Tabs. At this point you can see that there is a Mark modified tabs with asterisk option, just check it.

PhpStorm·’s automatic saving

PhpStorm provides an automatic saving function. However, for Hy369, it is still more accustomed to manually press Ctrl + S to save. This is set according to personal preference.

The setting method is as follows:

Open the Setting dialog box and click on Appearance & Behavior -> System Settings. At this point you can see that there are Save files on frame deactivation and Save files automatically if application is idle for options.

The previous item means: when the application loses focus (for example, you perform an operation to display the desktop, or switch to another application), save the currently modified file.

The latter item means: automatically save the modified file after the application is idle and inactive for the specified number of seconds.

If you need these two functions, just check and save. Hy369 naturally unchecked these two items.

Restore to the state before the last modification

If you accidentally operate some code by mistake, you will naturally have to undo it. The conventional method is naturally Ctrl + Z or 'Alt + Backspace`.

However, there are certain problems with the above method, that is, when the number of steps of the operation is too many (that is, you need to restore to a version a long time ago), at this time, follow the above It would be a bit embarrassing to do it. Because the number of steps that can be recovered by the above method is limited.

So, if we do a wrong operation, and even a day later, we find that something went wrong and we have to roll back, can we just admit defeat at this time?

Haha, friends who use PhpStorm don’t need to worry, because it has already provided us with a function that can save us from danger several times: Local History (this menu item can be seen in the VCS menu).

If you have used PhpStorm to operate some files, at this time, when you right-click the mouse when the file is activated, you will see a Local History menu, click on its lower-level menu In Show History, a dialog box will pop up.

Look at the sidebar of the dialog box, what do you see? Haha, if nothing else, you will see the recent operation record of the file. Click on an operation record, and you will find that the file content corresponding to the time node is displayed. You can clearly see the difference between the code at that time and the current code. Intuitive comparison.

Let me tell you quietly that the content in the comparison bar can be edited. Go and study the function after right-clicking in the comparison bar. There will be surprises.

If you want to directly restore the code at a certain time node, just right-click on that time node and select Revert. So, this function is really powerful, right?

The above is the content of PhpStorm usage memo (2). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PhpStorm usage notes (1)Next article:PhpStorm usage notes (1)