PhpStorm常用配置项

最近从Sublime Text 3换到phpstprm,还在适应中,快捷键什么不太一样,代码提示和自动完成这些的确是强大很多,不过因为功能多,界面繁杂很多。分享一些常用的简单配置,保持更新。

每个人配置都不一样,推荐大家配置好后导出一份配置,在其他工作环境下可以导入配置就可以了,phpstorm有个更好的功能叫Settings Repository,可以将配置文件保存到github上,不管在那,从这个地址直接拉去配置即可。

以下配置基于PhpStorm 2017.1.2

设置tab为4个空格缩进:

File -> Setting -> Editor ->Code Style -> PHP -> Tabs and Indents
取消勾选"Use tab character"

设置注释符缩进

phpstorm中,默认情况下,快捷键Ctrl + /会将注释符//放在第一列,设置注释缩进位置。

File -> Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces
取消勾选"Comment at first column"
File -> Settings -> Editor -> Code Style -> PHP -> Other -> Comment Code
取消勾选"Line comment at first colum"
添加勾选"Add a space at comment start"

去掉右侧白线

默认为了合适的代码宽度,编辑器的右侧会有一条线,这个没多大必要,关掉。

File -> Settings -> General -> Appearance
取消勾选"Show right margin (configured in Code Style options)"

打开自动换行

默认对于非常长的代码片段,不会自动换行,打开自动换行。

File -> Settings -> Editor -> General
勾选"Use soft wraps in editor"

关闭拼写检测spellchecker

这个单词拼写检测spellchecker在你写的单词错误的时候会有黄色波浪线提示,关闭它,界面会更整洁。

File -> Settings -> Editor -> Colors&Fonts -> General -> Errors and Warnings -> Typo
去掉"Effect"勾选

界面美化

安装Material Theme UI

File -> Settings -> Plugin -> Browse repositories
搜索"Material Theme UI","install"安装, 重启"phpstorm";
然后在工具栏"Tools"里面可以找到"Material Theme",可以快捷切换整个编辑器的主题风格;
在主题设置那里:
File -> Settings -> Colors & Fonts 可以找到很多与"Material Theme"编辑器主题风格匹配的风格了。

Server’s certificate is not trusted问题

打开phpstorm提示Server's certificate is not trusted错误,不影响使用,但是每次打开都会提示,从配置里把这个关掉:

File -> Setting -> Tools -> Server Certificates
勾选Acceptes non-trusted certificat automatically
重启
PhpStorm常用配置项

原文链接:https://beltxman.com/2105.html,若无特殊说明本站内容为 行星带 原创,未经同意禁止转载。

PhpStorm常用配置项”上有 2 条评论;

  1. 这些配置都很实用啊,谢谢分享!

评论已关闭。

Scroll to top