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

How to configure PhpStorm

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Editor to share with you how to configure PhpStorm, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Configuration sharing of an 8-year PhpStorm user

I have been using PhpStorm for a long time, almost 8 years. To be more precise, it began in 2012. It was the third edition at that time. A lot of things have happened and great changes have taken place during that time. That's for sure. You learn a lot every day. This article is a summary of my eight years of experience at PhpStorm, and my best settings make you a faster developer and focus on more important things.

If you don't care about the exact settings and their uses, you can download my snapshot (including my personal GitHub and Material themes) and import it into PhpStorm through File > Import Settings. Just scroll to the end of this article and you will find what you need.

My best settings

I will only show you the settings you need to change, which are different from the default settings. [] deselect or [x] make a selection.

General

Hide all the things you don't need

View > Appearance

● [] Toolbar

● [] Tool Window Bars

● [] Status Bar

● [] Navigation bar

Set up

Appearance & Behaviour > Appearance

● [] Animate windows

No improvement, but will degrade performanc

● [x] Show memory indicator

If you use the status bar to better understand memory usage

● [] Show tool window bars

Delete more useless status bars

● [] Show tool window numbers

Delete more useless status bars

Appearance & Behaviour > System Settings

● [] Reopen last project on startup

I develop multiple projects at the same time, so I want to choose which project should be opened at the beginning

● [] Confirm application exit

If I want to exit the application, I should close it immediately without any confirmation

● [x] Open project in new window

PhpStorm allows you to open the project in the same window as the current project. It's 99%. It's not what you want.

Appearance & Behaviour > File Colors

● [] Enable File Colors

● [] Use in Editor Tabs

● [] Use in Project View

Maybe you like it, maybe you don't. I have no idea. These options remove the file color and background color from the label and directory count and are used for some special folders, such as node_modules or tests.

Shortcut key

Basically I use the default shortcuts, but I have modified the following shortcuts to improve my efficiency.

Translator's note: the Cmd in macbook is equivalent to the Alt in Windows.

● Ctrl + V Split Vertically

Vertical split.

● Ctrl + H Split Horizontally

Split horizontally.

● Cmd + T Run...

If you are in the test file, you only need to press this shortcut key in the method to test the method.

● Shift + Cmd + T Run

This shortcut can be used anywhere in the program. It just runs the last test again.

● Ctrl + W Hide Active Tool Window

When you run the test, the test window opens. This can also be useful if you use terminals in PhpStorm. Using this shortcut, you can turn it off at any time.

● Cmd + 2 Select in Project View

You probably know that by now. Use Cmd + 1 to toggle the sidebar. I still often need to jump into the sidebar project tree. I often use Shift + Shift to search for everything, or Cmd + O to search for classes. So I never use the sidebar. However, this shortcut will be very useful if you want to use the currently open file to enter the menu.

Editor > General

● [] Enable Drag'n'Drop functionaliy in editor

This option is actually very useless. If you can't help using it, it can move the code with the mouse, which often happens, even if you don't want it.

● [] Show notification after reformat code action

● [] Show notification after optimize imports action

● [x] Soft-wrap-files

This is a very cool feature. When you edit an Markdown file, lines never wrap. With this option, you can change it. They've sealed him up now.

Strip trailing spaces on Save: All

This command removes all trailing spaces in each separate save command (PhpStorm saves it automatically if you don't use tabs).

● [] Always keep trailing spaces on caret line

● [x] Ensure line feed at file end on save

Using this option, you can ensure that there is a blank line at the end of the file.

Editor > General > Appearance

● [] Show hard wrap and visual guides

● [] Show code lens on scrollbar hover

This will remove the "preview" of the code when you hover over a specific location on the scroll bar.

Editor > General > Breadcrumbs

● [] Show Breadcrumbs

We don't need bread crumbs. So we disable it. We like a clean user interface.

Editor > General > Code Completion

● [x] Show full method signatures

We want to see everything when the method's code finishes starting.

Editor > General > Code Folding

Personally, I don't like any code folding because I want to see the code I write.

● [] Show coding folding outline

● [] File header

● [] Imports

● [] HTML 'style' attribute

● [] XML entities

● [] Data URIs

● [] Imports

Editor > General > Editor Tabs

● Appearance: None

If you do not use the tab, I recommend that you use this setting. You can use Cmd + E to get the most recent files or Shift + Shift to quickly search. Therefore, it is not necessary to display these tabs.

Editor > General > Smart Keys > PHP

● [] Enable smart function parameters completion

● [] Select variable name without'$'sign on double click

If I double-click a variable, I don't want it to check the $symbol, so I don't enable this setting.

Editor > General > Font

The configuration is more personalized and you can choose according to your preferences. The following is the configuration that suits me

● Font: Menlo

● Size: 15

● Line spacing: 1.9

Editor > General > Color Scheme > General

If you don't like these method separators as much as I do, you can disable them. You currently have no way to disable the delimiter of the use statement, but one solution is to unset the foreground color for the following items

● [] Method separator color, Foreground

Editor > General > Code Style

● Line Seperator: Unix and macOS

Editor > General > Inspections

You may wonder why I didn't explain. Making lists is very complicated. I've made some adjustments to Laravel here so that you can have a clean environment instead of annoying underscores. My spell check can also be found in the download package. If you have any questions, please let me know.

Editor > General > Inlay Hints

● [] Show hints for:

I don't need to display prompts.

Languages & Frameworks > PHP > Debug

● [] Force break at first line when no path mapping specified

● [] Force break at first line when a script is outside the project

When using Laravel Valet, you should cancel both. Otherwise, xdebug will start debugging in Valet.

Tools > Web Browsers

[] Show browsers popup in the editor

Do you remember all the previews with small browser icons? You can disable it.

The above is all the content of this article "how to configure PhpStorm". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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