1. 程式人生 > >Sublime text3 016 SublimeLinter(PHP 代碼檢測)

Sublime text3 016 SublimeLinter(PHP 代碼檢測)

語句 download change pre 目錄 issue osx pytho 更改

Sublime text3 016 SublimeLinter(PHP 代碼檢測)
------------------------------------------------------------------------------
如果有什麽不明白的,加QQ群:186970878

經常會有錯字 或 語句不通的,歡迎聯系本人,方便快速修正,也方便後來者閱讀。

聯系本人QQ: 2071551682
------------------------------------------------------------------------------
----------------------- PHP 代碼檢查 -----------------------------

使用 SublimeLinter 進行PHP代碼檢查

需要下載 sublimelinter 和 SublimeLinter-php


sublimelinter 用於高亮提示用戶編寫的代碼中存在的不規範和錯誤的寫法,支持 JavaScript、CSS、HTML、Java、PHP、Python、Ruby 等十多種開發語言。


SublimeLinter-php 使用的是 php -l 進行的檢查。
This linter plugin for SublimeLinter provides an interface to php -l. It will be used with files that have the “PHP”, “HTML”, or “HTML 5” syntax.


------------ SublimeLinter下載地址:----------------
https://packagecontrol.io/packages/SublimeLinter

VERSIONS
ST3 4.6.4
ST2 1.8.0
HOMEPAGE sublimelinter.com

http://www.sublimelinter.com/en/stable/

SublimeLinter repo and issues can be reached on GitHub.
點擊:GitHub 進入下網頁

https://github.com/SublimeLinter/SublimeLinter

Clone or download > Download ZIP

https://github.com/SublimeLinter/SublimeLinter.git

得到的文件:SublimeLinter-master.zip
文件修改時間 2018 6 4


---------- SublimeLinter - PHP -----

https://packagecontrol.io/packages/SublimeLinter-php

https://github.com/SublimeLinter/SublimeLinter-php
Clone or download > Download ZIP
https://github.com/SublimeLinter/SublimeLinter-php.git

得到的文件: SublimeLinter-php-master.zip
文件修改時間 2018 4 20
----------------------------------------------------

SublimeLinter 安裝


提示信息:

Package Control Messages
========================

SublimeLinter
-------------


____ _ _ _ _ _ _
/ ___| _ _| |__ | (_)_ __ ___ ___| | (_)_ __ | |_ ___ _ __
\___ \| | | | ‘_ \| | | ‘_ ` _ \ / _ \ | | | ‘_ \| __/ _ \ ‘__|
___) | |_| | |_) | | | | | | | | __/ |___| | | | | || __/ |
|____/ \__,_|_.__/|_|_|_| |_| |_|\___|_____|_|_| |_|\__\___|_|


Welcome to SublimeLinter, a linter framework for Sublime Text 3.
Linters are not included, they must be installed separately.


For complete documentation on how to use and configure SublimeLinter,
please see: http://www.sublimelinter.com

To report issues: https://github.com/SublimeLinter/SublimeLinter

-----------------------------------

SublimeLinter-php 安裝

提示信息:

SublimeLinter-php
-----------------

SublimeLinter-php
-------------------------------
This linter plugin for SublimeLinter provides an interface to php -l.

Please read the installation instructions at:

https://github.com/SublimeLinter/SublimeLinter-php

====================================================
安裝 sublimelinter 和 sublimelinter-php
SublimeLinter配置.依次點擊

Menu Preferences -> Package Settings -> SublimeLinter -> Settings 。

如果User為空復制一份 Default 中的內容到 User


右邊 User 參照 左邊 Default 語法:

----------------- 復制代碼 ----------------
// SublimeLinter Settings - User
{

"paths": {
"linux": [],
"osx": [],
"windows": [
"D://wamp64//bin//php//php5.6.25//php.exe",
"D://wamp64//bin//php//php7.0.10//php.exe"
]
},
}

----------------- 復制代碼 ---------------

測試成功 !!!
------------------------------------------------------

------------------- 檢查 設置說明 --------------------

什麽狀態下進行檢查的 設置說明。

// Lint Mode determines when the linter is run.
// Lint Mode 確定何時運行linter

// - background: asynchronously on every change
// background 異步地每一個變化

// - load_save: when a file is opened and every time it‘s saved
// load_save 當一個文件被打開,並且每次它被保存。

// - manual: only when calling the Lint This View command
// manual 只有在調用 Lint 這個視圖命令時


// - save: only when a file is saved
// save 只有當文件被保存時

// 下面是默認設置
"lint_mode": "background",


如果想更改調試方式,Default 復制到 User 文件中重新定義。

--------------------- 支持 語法提示 sublime-phpcs --------------------

下載插件 sublime-phpcs

和上面那兩個 插件是一個網站:
https://github.com/benmatselby/sublime-phpcs

解壓後修改文件夾名字為:phpcs

把文件夾放到packages目錄下


ctrl+shift+p -> install package

Sublime 自動對齊插件:alignment

BracketHighlighter 高亮顯示匹配的括號、引號和標簽

BracketHighlighter這個插件能在左側高亮顯示匹配的括號、引號和標簽,能匹配


------------------------------------------------------------------------------
如果有什麽不明白的,加QQ群:186970878

經常會有錯字 或 語句不通的,歡迎聯系本人,方便快速修正,也方便後來者閱讀。

聯系本人QQ: 2071551682
------------------------------------------------------------------------------

Sublime text3 016 SublimeLinter(PHP 代碼檢測)