SublimeLinter
=============
SublimeLinter is a plugin that supports "lint" programs (known as "linters"). SublimeLinter highlights
lines of code the linter deems to contain (potential) errors. It also
supports highlighting special annotations (for example: TODO) so that they
can be quickly located.
SublimeLinter has built in linters for the following languages:
* C/C++ - lint via `cppcheck`
* CoffeeScript - lint via `coffee -s -l`
* CSS - lint via built-in [csslint](http://csslint.net)
* Git Commit Messages - lint via built-in module based on [A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
* Haml - syntax check via `haml -c`
* HTML - lint via `tidy` (actually [tidy for HTML5](http://w3c.github.com/tidy-html5/))
* Java - lint via `javac -Xlint`
* Javascript - lint via built in [jshint](http://jshint.org), [jslint](http://jslint.com), or the [closure linter (gjslint)](https://developers.google.com/closure/utilities/docs/linter_howto) (if installed)
* Lua - syntax check via `luac`
* Objective-J - lint via built-in [capp_lint](https://github.com/aparajita/capp_lint)
* Perl - lint via [Perl:Critic](http://perlcritic.com/) or syntax+deprecation check via `perl -c`
* PHP - syntax check via `php -l`
* Puppet - syntax check via `puppet parser validate`
* Python - native, moderately-complete lint
* Ruby - syntax check via `ruby -wc`
* XML - lint via `xmllint`
Installing
----------
**With the Package Control plugin:** The easiest way to install SublimeLinter is through Package Control, which can be found at this site: http://wbond.net/sublime_packages/package_control
Once you install Package Control, restart ST2 and bring up the Command Palette (`Command+Shift+P` on OS X, `Control+Shift+P` on Linux/Windows). Select "Package Control: Install Package", wait while Package Control fetches the latest package list, then select SublimeLinter when the list appears. The advantage of using this method is that Package Control will automatically keep SublimeLinter up to date with the latest version.
**Without Git:** Download the latest source from [GitHub](https://github.com/SublimeLinter/SublimeLinter) and copy the SublimeLinter folder to your Sublime Text "Packages" directory.
**With Git:** Clone the repository in your Sublime Text "Packages" directory:
git clone https://github.com/SublimeLinter/SublimeLinter.git
The "Packages" directory is located at:
* OS X:
~/Library/Application Support/Sublime Text 2/Packages/
* Linux:
~/.config/sublime-text-2/Packages/
* Windows:
%APPDATA%/Sublime Text 2/Packages/
### Javascript-based linters
If you plan to edit files that use a Javascript-based linter (Javascript, CSS), your system
must have a Javascript engine installed. Mac OS X comes with a preinstalled Javascript engine called
JavaScriptCore, which is used if Node.js is not installed. On Windows, you **must** install the
Javascript engine Node.js, which can be downloaded from [the Node.js site](http://nodejs.org/#download).
On Mac OS X, you **must** install Node.js if you plan to edit Javascript or CSS files that
use non-ASCII characters in strings or comments, because JavaScriptCore is not Unicode-aware.
After installing Node.js, if the Node.js executable ("node" on Mac OS X, "node.exe" on Windows)
cannot be found by SublimeLinter, you may have to set the path to the executable in the
"sublimelinter\_executable\_map" setting. See the "Configuring" section below for info on
SublimeLinter settings.
Configuring
-----------
There are a number of settings available to customize the behavior of SublimeLinter and its linters. For the latest information on what settings are available, select the menu item `Preferences->Package Settings->SublimeLinter->Settings - Default`.
Do **NOT** edit the default SublimeLinter settings. Your changes will be lost when SublimeLinter is updated. ALWAYS edit the user SublimeLinter settings by selecting `Preferences->Package Settings->SublimeLinter->Settings - User`. Note that individual settings you include in your user settings will _completely_ replace the corresponding default setting, so you must provide that setting in its entirety.
### Linter-specific notes
Following are notes specific to individual linters that you should be aware of:
* **C/C++** - The default C/C++ linter is [cppcheck](http://cppcheck.sourceforge.net/), however Google's [cpplint.py](http://google-styleguide.googlecode.com/svn/trunk/cpplint/) is also supported.
To swap `cppcheck` out for `cpplint.py` you will need to adjust `sublimelinter_syntax_map` and possibly `sublimelinter_executable_map` also. First change the _linter language_ for `C` and `C++` to `c_cpplint` via `sublimelinter_syntax_map`. If `cpplint.py` is not on your system `PATH`, then add an entry for `c_cpplint` into `sublimelinter_executable_map` with the path to the file. As usual add these adjustments to the SublimeLinter **User Settings** file. An example:
"sublimelinter_syntax_map":
{
"Python Django": "python",
"Ruby on Rails": "ruby",
"C++": "c_cpplint",
"C": "c_cpplint"
},
"sublimelinter_executable_map":
{
"c_cpplint": "/Users/[my username]/Desktop/cpplint.py"
}
* **CSS** - This linter runs [csslint](http://csslint.net). This linter requires a Javascript engine (like Node.js) to be installed (see notes above for the JavaScript linters: "jshint" or "jslint").
By default all CSSLint settings are turned on. You may customize CSSLint behavior with the "csslint_options" setting. Please select `Preferences->Package Settings->SublimeLinter->Settings - Default` for more information on turning off or adjusting severity of tests. For more information about options available to CSSLint, see https://github.com/stubbornella/csslint/wiki/Rules.
* **HTML** - This linter will not run unless you have a version of tidy with HTML5 support. To use this linter, please see: https://github.com/w3c/tidy-html5
* **Java** - Because it uses `javac` to do linting, each time you run the linter the entire dependency graph of the current file will be checked. Depending on the number of classes you import, this can be **extremely** slow. Also note that you **must** provide the `-sourcepath`, `-classpath`, `-Xlint` and `{filename}` arguments to `javac` in your per-project settings. See "Per-project settings" below for more information.
* **JavaScript** - If the "javascript_linter" setting is "jshint" or "jslint", this linter runs [jshint](http://jshint.org) (or [jslint](http://jslint.com) respectively) using Node.js. See "Javascript-based linters" above for information on how to install Node.js.
If the "javascript_linter" setting is "gjslint", this linter runs the [closure linter (gjslint)](https://developers.google.com/closure/utilities/docs/linter_howto). After installation, if gjslint cannot be found by SublimeLinter, you may have to set the path to gjslint in the "sublimelinter\_executable\_map" setting.
You may want to modify the options passed to jshint, jslint, or gjslint. This can be done by using the **jshint_options**, **jslint_options**, or **gjslint_options** setting. Refer to the jshint.org site, the jslint.com site, or run `gjslint --help` for more information on the configuration options available.
SublimeLinter supports `.jshintrc` files. If using JSHint, SublimeLinter will recursively search the directory tree (from the file location to the file-system root directory). This functionality is specified in the [JSHint README](https://github.com/jshint/node-jshint/#within-your-projects-directory-tree).
* **Perl** - Due to a vulnerability (issue [#77](https://github.com/SublimeLinter/SublimeLinter/issues/77)) with the Perl linter, Perl syntax checking is no longer enabled by default. The default linter for Perl has been replaced by Perl::Critic. The standard Perl syntax checker can still be invoked by switching the "perl_lin
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
由于codeintel源码交付于github托管,sublime中下载codeintel会提示失败,自己编译又会有很多错误,甚至在不装codeintel使用ctags创建.tags文件后ctrl+P跳转到其他文件都会有bug,这个提供十个好用的插件,windows下直接win+r到%appdata%,sublime text2/packages/,解压缩到里面,重启sublime即可,绝对好用!
资源推荐
资源详情
资源评论
收起资源包目录
sublime 插件 包含 codeintel (993个子文件)
make.bat 5KB
make.bat 5KB
Obsidian.tmTheme.cache 2KB
python-2.6.cix 9.76MB
python-2.5.cix 8.66MB
python-2.7.cix 8.47MB
python-2.4.cix 7.91MB
python3-3.1.cix 5.9MB
python3-3.2.cix 5.82MB
perl-5.14.cix 3.72MB
ruby.cix 2.84MB
perl-5.12.cix 2.65MB
perl-5.10.cix 2.53MB
dojo.cix 2.39MB
perl-5.8.cix 2.04MB
ext.cix 2.01MB
pywin32.cix 1.78MB
python3-pywin32.cix 1.66MB
yui.cix 1.29MB
drupal.cix 1.29MB
php-5.3.cix 807KB
php-5.2.cix 727KB
php-5.0.cix 712KB
php-5.1.cix 711KB
mozilla_toolkit.cix 581KB
php-4.3.cix 565KB
php-4.4.cix 557KB
rails.cix 364KB
pecl.cix 345KB
javascript.cix 236KB
jquery.cix 126KB
mochikit.cix 118KB
prototype.cix 45KB
node.js.cix 30KB
html5.cix 23KB
xbl.cix 3KB
config 167B
config 167B
default.css 7KB
LexUDL.cxx 114KB
LexPerl.cxx 91KB
LexRuby.cxx 65KB
LexXSLT.cxx 30KB
LexCSS.cxx 24KB
LexCoffeeScript.cxx 18KB
LexTcl.cxx 16KB
.gitignore 94B
.gitignore 74B
.gitignore 38B
.gitignore 33B
.gitignore 28B
.gitignore 17B
.gitignore 6B
pcre-8.21.tar.gz 1.48MB
SilverCity-0.9.7.tar.gz 272KB
cElementTree-1.0.5-20051216.tar.gz 92KB
elementtree-1.2.6-20050316.tar.gz 41KB
SciLexer.h 41KB
Scintilla.h 29KB
SString.h 8KB
.hgignore 35B
SideBar Results.hidden-tmLanguage 1KB
csslint-node.js 293KB
jslint.js 218KB
jshint.js 167KB
http.js 12KB
fs.js 9KB
net.js 8KB
crypto.js 5KB
dgram.js 4KB
stream.js 4KB
process.js 4KB
dns.js 3KB
events.js 2KB
buffer.js 2KB
assert.js 2KB
child_process.js 2KB
vm.js 2KB
tls.js 2KB
global_objects.js 1KB
path.js 1KB
linter.js 1KB
url.js 1KB
https.js 1KB
jsc.js 1KB
timers.js 1KB
tty.js 1KB
util.js 1019B
node.js 976B
querystring.js 954B
os.js 926B
console.js 890B
repl.js 577B
linter.js 482B
linter.js 467B
repl.js 276B
debugger.js 274B
package_control.json 942B
messages.json 637B
package_control.json 491B
共 993 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
Stefanliang
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页