用Sublime做PHP开发,默认是没有语法检查的,这样只有运行了才可以看到语法错误.

但是有个插件 SublimeLinter

  • 第一步:使用Package Control 安装 SublimeLinter

  • 第二步:配置SublimeLinter

我的配置如下:

{
"user": {
    "debug": false,
    "delay": 0.25,
    "error_color": "D02000",
    "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
    "gutter_theme_excludes": [],
    "lint_mode": "background",
    "linters": {
        "php": {
            "@disable": false,
            "args": [],
            "excludes": []
        }
    },
    "mark_style": "outline",
    "no_column_highlights_line": false,
    "passive_warnings": false,
    "paths": {
        "linux": [],
        "osx": [],
        "windows": [
            "F:\\wnmp\\php\\php.exe"
        ]
    },
    "python_paths": {
        "linux": [],
        "osx": [],
        "windows": []
    },
    "rc_search_limit": 3,
    "shell_timeout": 10,
    "show_errors_on_save": true,
    "show_marks_in_minimap": true,
    "syntax_map": {
        "html (django)": "html",
        "html (rails)": "html",
        "html 5": "html",
        "javascript (babel)": "javascript",
        "magicpython": "python",
        "php": "html",
        "python django": "python",
        "pythonimproved": "python"
    },
    "warning_color": "DDB700",
    "wrap_find": true
}
}

保存,关闭试了下,发现还是不行.

后面再安装了一个插件SublimeLinter-php

就可以了