IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> PHP知识库 -> PHPStorm 常用设置 -> 正文阅读

[PHP知识库]PHPStorm 常用设置

参考版本 2019.3, 箭头(->)表示菜单顺序

常用设置菜单路径

  • 修改主题:

    Apperance & Behavior -> Apperance -> UI Options -> Theme

  • 代码自动(软)换行:

    Setting ->Editor -> General -> Soft Wraps -> 选择"Use soft wraps in editor", (新版本是"Soft-wrap files *", 添加需要自动换行的文件扩展名)

  • 修改代码字体:

    Setting ->Editor -> General -> Font

  • 注释用斜线不在行头:

    Setting ->Editor -> Code Style -> PHP -> Wrapping and Braces -> Keep when reformatting -> 取消"Comment at first column"

    以及:

    Setting ->Editor -> Code Style -> PHP -> Code Generation -> Comment Code -> 取消 “Line comment at first column”

    同时:

    Setting ->Editor -> Code Style -> HTML -> Code Generation -> Comments 下取消"Line commment at first column" 和 “Block commment at first column”

  • 代码自动完成的大小写区分取消:

    Setting ->Editor -> General -> Code Completion -> 取消 “Math case”

  • 大括号不换行

    Setting ->Editor -> Code Style -> PHP -> Wrapping and Braces -> Braces placement -> In class declaration 和 In function declaration 选择 End of line

  • EOL设置为unix格式:

    Setting ->Editor -> Code Style -> General -> Line Separtor 选择 “Unix and macOS(\n)”

  • 取消HTML属性的自动换行:

    Setting -> Editor -> Code Style -> HTML -> Other -> Wrap attributes 设置为 “Do not wrap”, 并取消"Wrap text".
    (那个"Hard wrap at"的默认值120在Editor -> Code Style -> Hard wrap at, 最大值是1000)

  • 取消输入引号时的自动补充:

    Setting ->Editor -> General -> Smart Keys 取消 “Surround selection on typeing quote or brace”

  • 选中相同文字高亮:

    Setting ->plugins -> 搜索 BrowseWordAtCaret 安装,然后重启; 然后进入 Settings -> Editor -> General -> Appearance -> Browse Word At Caret 勾选。
    如果想修改默认的颜色,在Settings -> Editor -> Colors & Font 或者 Color Scheme -> BrowseWordAtCaret 中进行修改,可以改成亮点的颜色。

  • else换行(不建议修改)

    Setting ->Editor -> Code Style -> PHP -> Warpping and Braces -> ‘if()’ statement -> 选中 “‘else’ on new line”

  • 修改搜索结果只显示前100个(100+ matches)的问题:

    顶部Help菜单 ->Edit Custom VM Options, 添加一行-Dide.usages.page.size=500就改成500了, 重启. (2019.3版本测试没问题)

    2021.2 版本中新增了设置Settings -> Advanced Settings -> Maximum number of results to show in Find In Path/Show Usages preview可以直接改.

  • 调整/关闭 SQL 代码背景色

Setting -> Editor -> Color Scheme -> General -> Code -> “Injected language fragment”,右边的 “Background” 复选框可以取消,或者选中后再选择一个自己喜欢的颜色。

  • 显示所有参数提示 (默认只显示非变量传入的参数提示)

Setting -> Editor -> Inlay hints -> PHP -> 选中 “Show name for all arguments”

或者: 在 “setting” 中 搜索"show parameter hints", 然后找到 “PHP” 对应的记录, 选中 “Show name for all arguments”

  • CSS代码保留单行块 (对html中的style块比较友好)
    Settings -> Editor -> Code Style -> Style Sheets -> CSSOther标签下, 下勾选 “Keep single-line blocks”

  • HTML中部分标签的子标签不缩进
    Settings -> Editor -> Code Style -> HTMLOther标签下, 在Do not indent children of里面添加不想缩进的标签, 比如: head

关闭不常用的代码检查

  • 对于thinkphp orm的table方法引起的"Non-static method ‘table’ should not be called statically, but clas has _magic"错误, 暂时取消 Editor -> Inspections -> PHP-> General ->"Dynamic method called as static"

  • Editor->Inspection->SQL:

    • No data sources configured
    • SQL dialect detection.
  • Editor->Inspection->HTML:

    • Anchor reference problems
    • File reference problems
    • Form input without an associated label or title attribute
    • Image size mismatch
    • Missing required attribute
    • Presentational HTML tag
    • Quirks mode(兼容模式检查).
  • Editor->Inspection->CSS:

    • Unused CSS selector.
  • Editor->Inspection->CSS->Probable bugs:

    • Missing generic font name.
  • Editor->Inspection->Javascript->ECMScript 6 migration aids:

    • ‘var’ used instead of ‘let’ or ‘const’.
  • Editor->Inspection->PHP: Statement has empty body:

    • Comments count as content
  PHP知识库 最新文章
Laravel 下实现 Google 2fa 验证
UUCTF WP
DASCTF10月 web
XAMPP任意命令执行提升权限漏洞(CVE-2020-
[GYCTF2020]Easyphp
iwebsec靶场 代码执行关卡通关笔记
多个线程同步执行,多个线程依次执行,多个
php 没事记录下常用方法 (TP5.1)
php之jwt
2021-09-18
上一篇文章      下一篇文章      查看所有文章
加:2022-09-24 20:37:31  更:2022-09-24 20:37:34 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/5 11:17:22-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码