sublime text3配置php语法检查

1. 先安装插件 sublimelinter

2. 再安装插件 sublimelinter-php

3. 在sublimelinter的user配置文件里(在 Sublime Text 3菜单打开:Preferences -> Package Setting -> SublimeLinter -> Setting User)写入以下配置项:

// SublimeLinter Settings - User

{
    "debug": false,
    "delay": 0.25,
    "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
    "lint_mode": "background",
    "linters": {
        "annotations": {
            "@disable": false,
            "args": [],
            "errors": [
                "FIXME"
            ],
            "excludes": [],
            "warnings": [
                "NOTE",
                "README",
                "TODO",
                "XXX",
                "@todo"
            ]
        },
        "php": {
            "@disable": false,
            "args": [],
            "excludes": []
        },
        "summitlinter": {
            "@disable": false,
            "args": [],
            "excludes": [],
            "globals": "",
            "ignore": "channel",
            "limit": null,
            "only": ""
        }
    },
    "no_column_highlights_line": false,
    "paths": {
        "linux": [],
        "osx": [],
        "windows": [
            "E:\\WampServer\\bin\\php\\php7.3.5"
        ]
    },
    "show_marks_in_minimap": true,
    "syntax_map": {
        "html (django)": "html",
        "html (rails)": "html",
        "html 5": "html",
        "javascript (babel)": "javascript",
        "magicpython": "python",
        "php": "php",
        "python django": "python",
        "pythonimproved": "python"
    },
}

最主要的是:

"paths": {
        "linux": [],
        "osx": [],
        "windows": [
            "E:\\WampServer\\bin\\php\\php7.3.5"
        ]
    },

本机上安装的PHP执行文件路径要正确,根据自己的实际安装路径填写;
全部配置好之后,关闭sublime,重新启动;

你可能感兴趣的:(sublime text3配置php语法检查)