Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Tips for improving daily work efficiency in PhpStorm

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the knowledge of "sharing tips to improve daily work efficiency in PhpStorm". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Edit text

In PhpStorm, we can edit multiple text at the same time by anchoring multiple cursors. Take the following code as an example, we first move the cursor to the starting position of the text to be edited:

Then hold down the Option key (the Windows system is the Alt key) and move the cursor to the beginning of the other text you want to edit:

In this way, more than one text to be edited is selected at the same time, and by editing any text, you can modify the text in other locations at the same time:

If the code snippet to edit is long, and there are many text positions to edit at the same time, it is troublesome to hold down the Option key to move the cursor all the time, or you can use the Ctrl + G shortcut to select the next location to modify:

Split window

In the development of a Web project in MVC mode, a request has to go through routing-> Controller-> Model Class-> View to complete the final rendering and send the response to the user. Sometimes in order to debug the problem, we may need to switch repeatedly between controllers, model classes, and view templates. Wouldn't it be convenient if we could put them directly into a window?

In PhpStorm, this can be done by splitting the window:

You can split the window by navigating the menu bar Windows-> Editor Tabs-> Split Vertically (vertical split) / Split Horizontally (horizontal split):

For a split window, you can unsplit it through Unsplit.

You can also split the file to a specified location through the right-click menu on the Tab tab of the open file:

It's very simple. You can learn it quickly by experiencing it. PhpStorm does not provide shortcut keys for window segmentation. If necessary, you can configure it through the Preferences | Keymap interface:

Search scope

We have covered in detail how to navigate to specified files, classes, methods, and properties in the code navigation section, but this navigation is to determine navigation, that is, to navigate to a specific location that can be a file, class, method, or property.

Sometimes, we also have the need to search a specified directory for all locations where a variable or code snippet appears in order to replace or modify in batches, this search is uncertain and may appear in multiple locations of multiple files. This kind of search can be done through Find in Path. To complete the operation (the corresponding shortcut key is Shift + Command + F), for example, if we want to search for a variable under the blog directory, we can do this (select the directory, right-click-> Find in Path... ):

By default, PhpStorm provides search scope at several levels: project (Project), module (Module), directory (Directoy), and scope (Scope) (search under selected directory by default):

Very rich PhpStorm built-in search scope (including all locations, project and library files, console, recently browsed / modified files, open files, current files, etc.) is included in the Scope:

In addition, you can customize the search scope by adding a new scope (click on the right side of the scope drop-down box. Button, click the + button in the upper left corner of the pop-up window):

Name the custom scope "File | Custom":

Next, we select the directory to search in the custom scope window, click "Include Recursively", and the corresponding directory mode is automatically populated in the Pattern input box:

You can also exclude specific directories from specified search directories, for example, here we exclude vendor subdirectories:

The corresponding Pattern directory pattern string is automatically updated. Click "Apply" to apply changes, save the custom scope configuration, and click "OK" to close the window.

If you specify the search scope as custom "File | Custom", you can only search under the blog directory, and the vendor library files are excluded:

This is the end of the content of "sharing tips to improve daily work efficiency in PhpStorm". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report