PhpStorm efficient development tips: shortcut keys, plugins and themes
This article will share some shortcut keys and techniques for PhpStorm to help you improve your development efficiency. Some of the contents are discussed in Reddit. Due to different operating system and environment, shortcut keys may differ slightly. Please refer to the JetBrains official reference card.
Key points:
Shortcut keys and techniques:
Code Format (Ctrl Alt L): Format the code according to your code style guide. Macros can be set so that they are automatically formatted when saved (but be careful when teamwork).
Skip to last editing location (Ctrl Shift Backspace): Switch different editing locations in large files. This function can also be achieved by the mouse's "Forward" and "Back" buttons.
View variable or method definition (Ctrl mouse over/Ctrl B): View the full name or declared position of the variable or method. Ctrl Click on the variable or method, or press Ctrl B on the method call or variable to jump directly to the definition.
Code prompt (Ctrl Space): Displays the code prompt dialog box.
Problem Detection and Quick Fix (Alt Enter): PhpStorm underlines the problem area and displays the light bulb icon. Click the light bulb or press Alt Enter to view and apply the suggested solutions.
Quickly jump to file or class (Ctrl N/Ctrl Shift N): Quickly jump to any file or class in the project. Supports fuzzy search and line numbers (for example: 文件名:行号
).
Multi-level clipboard (Ctrl Shift V): Access multiple clipboard content.
Command search (Ctrl Shift A): Search for IDE commands.
Emmet HTML code generation: Use Emmet to quickly generate HTML code. For example, entering div#myDiv>span.mySpanClass>ul>li*5
and pressing the Tab key will generate the corresponding HTML structure.
Code Block Selection (Ctrl W): Select the code block and repeatedly press to expand the selection range.
Context-aware editing (Alt Enter): Edit HTML and other content in PHP strings.
Column selection mode (drag the middle mouse button): Select the same column for multiple lines of code.
Breadcrumb navigation (Alt Home): Use the cursor to move in the Breadcrumb navigation.
Refactor (Shift F6/Shift Alt Ctrl T): Rename the variable and apply the changes.
Method to jump to the current file (Ctrl F12): A specific method to jump to the current file.
Global Search (Double-click Shift): Search for anything in the project or IDE.
Plugin:
Dark theme:
Darcula (built-in) and Solarized themes are recommended for improved readability and reduced eye fatigue.
Summary:
This article introduces some efficient development tips for PhpStorm, including shortcut keys, plug-ins, and theme selection. Hope these tips will help you improve your development efficiency. Welcome to share your tips and experiences in the comments!
(The following is FAQ, which has been rewritten according to the original text and has been streamlined)
FAQ:
文件
> 设置
> 按键映射
, search operation, add shortcut keys. Ctrl B
Jump to definition, Ctrl [
/Ctrl ]
Code block jump, Ctrl E
Recently opened file. 生成
or Alt Insert
. Ctrl Alt Shift T
or right-click > 重构
. Shift F9
. 视图
> 工具窗口
> 数据库
, add data source. VCS
> 启用版本控制集成
, select Git. 文件
> 设置
> 构建、执行、部署
> Docker
> 文件
设置
> 语言与框架
> PHP
> 测试框架
>
/uploads/20250222/...
The above is the detailed content of PhpStorm - Top Productivity Hacks and Shortcuts. For more information, please follow other related articles on the PHP Chinese website!