phpstorm安装好之后,先别急着编码。工欲善其事,必先利其器,配置好下面这些之后让编码事半功倍。
Appearance & Behavior
-> Appearance
-> Theme 选中 [Light with Light Header] 亮色较为护眼
Appearance & Behavior
-> System Settings
-> Updates 去掉勾选 [Check IDE updates for]
配合 Ctrl + S 使用
Editor
-> General
-> On Save 勾选 [Remove trailing spaces on [All lines]]
去掉勾选 [Keep trailing spaces on caret line]
Editor
-> General
-> Console [Default Encoding: [UTF-8]]
配合 Ctrl + Alt + L格式化代码
Editor
-> Code Style
-> PHP 选中PSR2规范 [set from… [PSR12]]
在[Wrapping and Braces]中,[Hard wrap at]按照实际设置宽度,我设置我120
Editor
-> File encoding
-> [Global Encoding [UTF-8]]
[Project Encoding [UTF-8]]
[Default encoding for properties files [UTF-8]]
Plugins
-> 搜索 Swagger 安装 [SwaggerHub API Design by SmartBear]
-> 搜索 Annotaions 安装 [PHP Annotaions]
Plugins
-> 搜索 chinese 安装 [Chinese (Simpllified) Language Pack]
Version Control
-> GitLab 添加自己的访问口令,添加gitlab地址,登录gitlab后,生成访问令牌,粘贴令牌到输入框保存即可
PHP
-> Composer [Execution [composer.phar]]
选择本地已下载好的composer.phar或者
在本地未下载composer.phar时,勾选 [Download composer-stable.phar from getcomposer.org]
PHP
-> Test Frameworks [PHPUnit library [Path to phpunit.phar]]
选择本地已下载好的phpunit.phar或者
在本地未下载phpunit.phar时,点击 [Download phpunit.phar from xxx]
如果是在windows下之前自带编辑器写的代码,最优答案就是用这里统一处理
File
-> File Properties
移除Bom [Remove Bom]
行格式转换 [Line Separators [LF Unix…]]
都看到这里了,点个赞再走吧!