mirror of
https://github.com/amix/vimrc
synced 2025-06-23 23:15:01 +08:00
Updated plugins
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
## 1. Bug reports / GitHub issues
|
||||
|
||||
Please note that the preferred channel for posting bug reports is the
|
||||
[issue tracker at GitHub][0]. Reports posted elsewhere are less likely
|
||||
[issue tracker at GitHub][bug_tracker]. Reports posted elsewhere are less likely
|
||||
to be seen by the core team.
|
||||
|
||||
When reporting a bug make sure you search the existing GitHub issues
|
||||
@ -39,14 +39,14 @@ too:
|
||||
## 2. Submitting a patch
|
||||
|
||||
Before you consider adding features to syntastic, _please_ spend a few minutes
|
||||
(re-)reading the latest version of the [manual][1]. Syntastic is changing
|
||||
(re-)reading the latest version of the [manual][manual]. Syntastic is changing
|
||||
rapidly at times, and it's possible that some features you want to add exist
|
||||
already.
|
||||
|
||||
To submit a patch:
|
||||
|
||||
* fork the [repo][2] on GitHub;
|
||||
* make a [topic branch][3] and start hacking;
|
||||
* fork the [repo][github] on GitHub;
|
||||
* make a [topic branch][branches] and start hacking;
|
||||
* submit a pull request based off your topic branch.
|
||||
|
||||
Small, focused patches are preferred.
|
||||
@ -69,14 +69,14 @@ Follow the coding conventions/styles used in the syntastic core:
|
||||
* don't use `l:` prefixes for variables unless actually required (i.e.
|
||||
almost never);
|
||||
* code for maintainability; we would rather a function be a couple of
|
||||
lines longer and have (for example) some [explaining variables][4] to
|
||||
lines longer and have (for example) some [explaining variables][variables] to
|
||||
aid readability.
|
||||
|
||||
<a name="checkerstyle"></a>
|
||||
|
||||
## 4. Syntax checker notes
|
||||
|
||||
Make sure to read the [guide][5] if you plan to add new syntax checkers.
|
||||
Make sure to read the [guide][guide] if you plan to add new syntax checkers.
|
||||
|
||||
Use the existing checkers as templates, rather than writing everything
|
||||
from scratch.
|
||||
@ -97,9 +97,9 @@ let errorformat =
|
||||
\ '%-G%.%#'
|
||||
```
|
||||
|
||||
[0]: https://github.com/scrooloose/syntastic/issues
|
||||
[1]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
|
||||
[2]: https://github.com/scrooloose/syntastic
|
||||
[3]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches
|
||||
[4]: http://www.refactoring.com/catalog/extractVariable.html
|
||||
[5]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
[bug_tracker]: https://github.com/scrooloose/syntastic/issues
|
||||
[manual]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
|
||||
[github]: https://github.com/scrooloose/syntastic
|
||||
[branches]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches
|
||||
[variables]: http://www.refactoring.com/catalog/extractVariable.html
|
||||
[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
|
@ -46,37 +46,38 @@
|
||||
|
||||
## 1\. Introduction
|
||||
|
||||
Syntastic is a syntax checking plugin for [Vim][13] that runs files through
|
||||
Syntastic is a syntax checking plugin for [Vim][vim] that runs files through
|
||||
external syntax checkers and displays any resulting errors to the user. This
|
||||
can be done on demand, or automatically as files are saved. If syntax errors
|
||||
are detected, the user is notified and is happy because they didn't have to
|
||||
compile their code or execute their script to find them.
|
||||
|
||||
At the time of this writing, syntastic has checking plugins for ActionScript,
|
||||
Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, ASM,
|
||||
BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco,
|
||||
Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir,
|
||||
Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, Assembly
|
||||
languages, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript,
|
||||
Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir,
|
||||
Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
|
||||
Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP,
|
||||
LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix,
|
||||
Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable
|
||||
Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python, QML,
|
||||
R, Racket, RDF TriG, RDF Turtle, Relax NG, reStructuredText, RPM spec, Ruby,
|
||||
SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig,
|
||||
TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery, YACC, YAML,
|
||||
YANG data models, z80, Zope page templates, and zsh. See the [wiki][3] for
|
||||
details about the corresponding supported checkers.
|
||||
Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python,
|
||||
QML, R, Racket, RDF TriG, RDF Turtle, Relax NG, reStructuredText, RPM spec,
|
||||
Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo,
|
||||
Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery,
|
||||
YACC, YAML, YANG data models, z80, Zope page templates, and Zsh. See the
|
||||
[manual][checkers] for details about the corresponding supported checkers
|
||||
(`:help syntastic-checkers` in Vim).
|
||||
|
||||
A number of third-party Vim plugins also provide checkers for syntastic,
|
||||
for example: [merlin][30], [omnisharp-vim][25], [rust.vim][12],
|
||||
[syntastic-extras][26], [syntastic-more][27], [vim-crystal][29],
|
||||
[vim-eastwood][28], and [vim-swift][24].
|
||||
for example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust],
|
||||
[syntastic-extras][myint], [syntastic-more][roktas], [vim-crystal][crystal],
|
||||
[vim-eastwood][eastwood], and [vim-swift][swift].
|
||||
|
||||
Below is a screenshot showing the methods that Syntastic uses to display syntax
|
||||
errors. Note that, in practise, you will only have a subset of these methods
|
||||
enabled.
|
||||
|
||||
![Screenshot 1][0]
|
||||
![Screenshot 1][screenshot]
|
||||
|
||||
1. Errors are loaded into the location list for the corresponding window.
|
||||
2. When the cursor is on a line containing an error, the error message is echoed in the command window.
|
||||
@ -94,7 +95,7 @@ enabled.
|
||||
### 2.1\. Requirements
|
||||
|
||||
Syntastic itself has rather relaxed requirements: it doesn't have any external
|
||||
dependencies, and it needs a version of [Vim][13] compiled with a few common
|
||||
dependencies, and it needs a version of [Vim][vim] compiled with a few common
|
||||
features: `autocmd`, `eval`, `file_in_path`, `modify_fname`, `quickfix`,
|
||||
`reltime`, and `user_commands`. Not all possible combinations of features that
|
||||
include the ones above make equal sense on all operating systems, but Vim
|
||||
@ -102,8 +103,8 @@ version 7 or later with the "normal", "big", or "huge" feature sets should be
|
||||
fine.
|
||||
|
||||
Syntastic should work with any modern plugin managers for Vim, such as
|
||||
[NeoBundle][14], [Pathogen][1], [Vim-Addon-Manager][15], [Vim-Plug][16], or
|
||||
[Vundle][17]. Instructions for installing syntastic with [Pathogen][1] are
|
||||
[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam], [Vim-Plug][plug], or
|
||||
[Vundle][vundle]. Instructions for installing syntastic with [Pathogen][pathogen] are
|
||||
included below for completeness.
|
||||
|
||||
Starting with Vim version 7.4.1486 you can also load syntastic using the
|
||||
@ -115,20 +116,21 @@ syntastic is present only in versions 7.4.1486 and later.
|
||||
Last but not least: syntastic doesn't know how to do any syntax checks by
|
||||
itself. In order to get meaningful results you need to install external
|
||||
checkers corresponding to the types of files you use. Please consult the
|
||||
[wiki][3] for a list of supported checkers.
|
||||
[manual][checkers] (`:help syntastic-checkers` in Vim) for a list of supported
|
||||
checkers.
|
||||
|
||||
<a name="installpathogen"></a>
|
||||
|
||||
### 2.2\. Installing syntastic with Pathogen
|
||||
|
||||
If you already have [Pathogen][1] working then skip [Step 1](#step1) and go to
|
||||
If you already have [Pathogen][pathogen] working then skip [Step 1](#step1) and go to
|
||||
[Step 2](#step2).
|
||||
|
||||
<a name="step1"></a>
|
||||
|
||||
#### 2.2.1\. Step 1: Install pathogen.vim
|
||||
|
||||
First I'll show you how to install Tim Pope's [Pathogen][1] so that it's easy to
|
||||
First I'll show you how to install Tim Pope's [Pathogen][pathogen] so that it's easy to
|
||||
install syntastic. Do this in your terminal so that you get the `pathogen.vim`
|
||||
file and the directories it needs:
|
||||
```sh
|
||||
@ -155,7 +157,7 @@ Quit vim and start it back up to reload it, then type:
|
||||
:Helptags
|
||||
```
|
||||
If you get an error when you do this, then you probably didn't install
|
||||
[Pathogen][1] right. Go back to [Step 1](#step1) and make sure you did the
|
||||
[Pathogen][pathogen] right. Go back to [Step 1](#step1) and make sure you did the
|
||||
following:
|
||||
|
||||
1. Created both the `~/.vim/autoload` and `~/.vim/bundle` directories.
|
||||
@ -192,10 +194,11 @@ __4.1. Q. I installed syntastic but it isn't reporting any errors...__
|
||||
|
||||
A. The most likely reason is that none of the syntax checkers that it requires
|
||||
are installed. For example: by default, python requires either `flake8` or
|
||||
`pylint` to be installed and in your `$PATH`. To see which executables are
|
||||
supported, look at the [wiki][3]. Note that aliases do not work; the actual
|
||||
executables must be available in your `$PATH`. Symbolic links are okay though.
|
||||
You can see syntastic's idea of available checkers by running `:SyntasticInfo`.
|
||||
`pylint` to be installed and in your `$PATH`. Read the [manual][checkers]
|
||||
(`:help syntastic-checkers` in Vim) to find out what executables are
|
||||
supported. Note that aliases do not work; the actual executables must be
|
||||
available in your `$PATH`. Symbolic links are okay though. You can see
|
||||
syntastic's idea of available checkers by running `:SyntasticInfo`.
|
||||
|
||||
A second probable reason is that none of the available checkers are
|
||||
enabled. Syntastic comes preconfigured with a default list of enabled checkers
|
||||
@ -222,7 +225,7 @@ on Windows.
|
||||
Finally, another reason it could fail is that either the command line options
|
||||
or the error output for a syntax checker may have changed. In this case, make
|
||||
sure you have the latest version of the syntax checker installed. If it still
|
||||
fails then post an [issue][4] - or better yet, create a pull request.
|
||||
fails then post an [issue][bug_tracker] - or better yet, create a pull request.
|
||||
|
||||
<a name="faqpython3"></a>
|
||||
|
||||
@ -238,18 +241,18 @@ let g:syntastic_python_python_exec = '/path/to/python3'
|
||||
|
||||
__4.3. Q. Are there any local checkers for HTML5 that I can use with syntastic?__
|
||||
|
||||
[HTML Tidy][18] has a fork named [HTML Tidy for HTML5][19]. It's a drop
|
||||
[HTML Tidy][tidy_old] has a fork named [HTML Tidy for HTML5][tidy]. It's a drop
|
||||
in replacement, and syntastic can use it without changes. Just install it
|
||||
somewhere and point `g:syntastic_html_tidy_exec` to its executable:
|
||||
```vim
|
||||
let g:syntastic_html_tidy_exec = 'tidy5'
|
||||
```
|
||||
Alternatively, you can install [vnu.jar][21] from the [validator.nu][20]
|
||||
project and run it as a [HTTP server][23]:
|
||||
Alternatively, you can install [vnu.jar][vnu_jar] from the [validator.nu][vnu]
|
||||
project and run it as a [HTTP server][vnu_server]:
|
||||
```sh
|
||||
$ java -Xss512k -cp /path/to/vnu.jar nu.validator.servlet.Main 8888
|
||||
```
|
||||
Then you can [configure][22] syntastic to use it:
|
||||
Then you can configure syntastic to use it:
|
||||
```vim
|
||||
let g:syntastic_html_validator_api = 'http://localhost:8888/'
|
||||
```
|
||||
@ -260,7 +263,7 @@ __4.4. Q. The `perl` checker has stopped working...__
|
||||
|
||||
A. The `perl` checker runs `perl -c` against your file, which in turn
|
||||
__executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use`
|
||||
statements in your file (cf. [perlrun][10]). This is probably fine if you
|
||||
statements in your file (cf. [perlrun][perlrun]). This is probably fine if you
|
||||
wrote the file yourself, but it's a security problem if you're checking
|
||||
third-party files. Since there is currently no way to disable this behaviour
|
||||
while still producing useful results, the checker is now disabled by default.
|
||||
@ -274,7 +277,7 @@ let g:syntastic_enable_perl_checker = 1
|
||||
|
||||
__4.5. Q. What happened to the `rustc` checker?__
|
||||
|
||||
A. It is now part of the [rust.vim][12] plugin. If you install this plugin the
|
||||
A. It is now part of the [rust.vim][rust] plugin. If you install this plugin the
|
||||
checker should be picked up automatically by syntastic.
|
||||
|
||||
<a name="faqxcrun"></a>
|
||||
@ -282,7 +285,7 @@ checker should be picked up automatically by syntastic.
|
||||
__4.6. Q. What happened to the `xcrun` checker?__
|
||||
|
||||
A. The `xcrun` checker used to have a security problem and it has been removed.
|
||||
A better checker for __Swift__ is part of the [vim-swift][24] plugin. If you
|
||||
A better checker for __Swift__ is part of the [vim-swift][swift] plugin. If you
|
||||
install this plugin the checker should be picked up automatically by syntastic.
|
||||
|
||||
<a name="faqloclist"></a>
|
||||
@ -324,8 +327,8 @@ A. Stick a line like this in your `vimrc`:
|
||||
let g:syntastic_<filetype>_checkers = ['<checker-name>']
|
||||
```
|
||||
|
||||
To see the list of supported checkers for your filetype look at the
|
||||
[wiki][3].
|
||||
To see the list of supported checkers for your filetype read the
|
||||
[manual][checkers] (`:help syntastic-checkers` in Vim).
|
||||
|
||||
e.g. Python has the following checkers, among others: `flake8`, `pyflakes`,
|
||||
`pylint` and a native `python` checker.
|
||||
@ -406,7 +409,7 @@ A. Vim provides several built-in commands for this. See `:help :lnext` and
|
||||
`:help :lprevious`.
|
||||
|
||||
If you use these commands a lot then you may want to add shortcut mappings to
|
||||
your `vimrc`, or install something like [unimpaired][2], which provides such
|
||||
your `vimrc`, or install something like [unimpaired][unimpaired], which provides such
|
||||
mappings (among other things).
|
||||
|
||||
<a name="faqbdelete"></a>
|
||||
@ -427,50 +430,50 @@ cabbrev <silent> bd <C-r>=(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdele
|
||||
## 5\. Resources
|
||||
|
||||
The preferred place for posting suggestions, reporting bugs, and general
|
||||
discussions related to syntastic is the [issue tracker at GitHub][4].
|
||||
A guide for writing syntax checkers can be found in the [wiki][11].
|
||||
There are also a dedicated [google group][5], and a
|
||||
[syntastic tag at StackOverflow][6].
|
||||
discussions related to syntastic is the [issue tracker at GitHub][bug_tracker].
|
||||
A guide for writing syntax checkers can be found in the [wiki][guide].
|
||||
There are also a dedicated [google group][google_group], and a
|
||||
[syntastic tag at StackOverflow][stack_overflow].
|
||||
|
||||
Syntastic aims to provide a common interface to syntax checkers for as many
|
||||
languages as possible. For particular languages, there are, of course, other
|
||||
plugins that provide more functionality than syntastic. You might want to take
|
||||
a look at [ghcmod-vim][31], [jedi-vim][7], [python-mode][8], [vim-go][32], or
|
||||
[YouCompleteMe][9].
|
||||
a look at [ghcmod-vim][ghcmod], [jedi-vim][jedi], [python-mode][python_mode], [vim-go][vimgo], or
|
||||
[YouCompleteMe][ycm].
|
||||
|
||||
[0]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png
|
||||
[1]: https://github.com/tpope/vim-pathogen
|
||||
[2]: https://github.com/tpope/vim-unimpaired
|
||||
[3]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers
|
||||
[4]: https://github.com/scrooloose/syntastic/issues
|
||||
[5]: https://groups.google.com/group/vim-syntastic
|
||||
[6]: http://stackoverflow.com/questions/tagged/syntastic
|
||||
[7]: https://github.com/davidhalter/jedi-vim
|
||||
[8]: https://github.com/klen/python-mode
|
||||
[9]: http://valloric.github.io/YouCompleteMe/
|
||||
[10]: http://perldoc.perl.org/perlrun.html#*-c*
|
||||
[11]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
[12]: https://github.com/rust-lang/rust.vim
|
||||
[13]: http://www.vim.org/
|
||||
[14]: https://github.com/Shougo/neobundle.vim
|
||||
[15]: https://github.com/MarcWeber/vim-addon-manager
|
||||
[16]: https://github.com/junegunn/vim-plug/
|
||||
[17]: https://github.com/gmarik/Vundle.vim
|
||||
[18]: http://tidy.sourceforge.net/
|
||||
[19]: http://www.htacg.org/tidy-html5/
|
||||
[20]: http://about.validator.nu/
|
||||
[21]: https://github.com/validator/validator/releases/latest
|
||||
[22]: https://github.com/scrooloose/syntastic/wiki/HTML%3A---validator
|
||||
[23]: http://validator.github.io/validator/#standalone
|
||||
[24]: https://github.com/kballard/vim-swift
|
||||
[25]: https://github.com/OmniSharp/omnisharp-vim
|
||||
[26]: https://github.com/myint/syntastic-extras
|
||||
[27]: https://github.com/roktas/syntastic-more
|
||||
[28]: https://github.com/venantius/vim-eastwood
|
||||
[29]: https://github.com/rhysd/vim-crystal
|
||||
[30]: https://github.com/the-lambda-church/merlin
|
||||
[31]: https://github.com/eagletmt/ghcmod-vim
|
||||
[32]: https://github.com/fatih/vim-go
|
||||
[screenshot]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png
|
||||
|
||||
[bug_tracker]: https://github.com/scrooloose/syntastic/issues
|
||||
[checkers]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic-checkers.txt
|
||||
[crystal]: https://github.com/rhysd/vim-crystal
|
||||
[eastwood]: https://github.com/venantius/vim-eastwood
|
||||
[ghcmod]: https://github.com/eagletmt/ghcmod-vim
|
||||
[google_group]: https://groups.google.com/group/vim-syntastic
|
||||
[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
|
||||
[jedi]: https://github.com/davidhalter/jedi-vim
|
||||
[merlin]: https://github.com/the-lambda-church/merlin
|
||||
[myint]: https://github.com/myint/syntastic-extras
|
||||
[neobundle]: https://github.com/Shougo/neobundle.vim
|
||||
[omnisharp]: https://github.com/OmniSharp/omnisharp-vim
|
||||
[pathogen]: https://github.com/tpope/vim-pathogen
|
||||
[perlrun]: http://perldoc.perl.org/perlrun.html#*-c*
|
||||
[plug]: https://github.com/junegunn/vim-plug/
|
||||
[python_mode]: https://github.com/klen/python-mode
|
||||
[roktas]: https://github.com/roktas/syntastic-more
|
||||
[rust]: https://github.com/rust-lang/rust.vim
|
||||
[stack_overflow]: http://stackoverflow.com/questions/tagged/syntastic
|
||||
[swift]: https://github.com/kballard/vim-swift
|
||||
[tidy]: http://www.htacg.org/tidy-html5/
|
||||
[tidy_old]: http://tidy.sourceforge.net/
|
||||
[unimpaired]: https://github.com/tpope/vim-unimpaired
|
||||
[vam]: https://github.com/MarcWeber/vim-addon-manager
|
||||
[vim]: http://www.vim.org/
|
||||
[vimgo]: https://github.com/fatih/vim-go
|
||||
[vnu]: http://about.validator.nu/
|
||||
[vnu_jar]: https://github.com/validator/validator/releases/latest
|
||||
[vnu_server]: http://validator.github.io/validator/#standalone
|
||||
[vundle]: https://github.com/gmarik/Vundle.vim
|
||||
[ycm]: http://valloric.github.io/YouCompleteMe/
|
||||
|
||||
<!--
|
||||
vim:tw=79:sw=4:
|
||||
|
@ -357,6 +357,54 @@ function! syntastic#preprocess#stylelint(errors) abort " {{{2
|
||||
return out
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#preprocess#tern_lint(errors) abort " {{{2
|
||||
let errs = join(a:errors, '')
|
||||
let json = s:_decode_JSON(errs)
|
||||
|
||||
echomsg string(json)
|
||||
let out = []
|
||||
if type(json) == type({}) && has_key(json, 'messages') && type(json['messages']) == type([])
|
||||
for e in json['messages']
|
||||
try
|
||||
let line_from = byte2line(e['from'] + 1)
|
||||
if line_from > 0
|
||||
let line = line_from
|
||||
let column = e['from'] - line2byte(line_from) + 2
|
||||
let line_to = byte2line(e['from'] + 1)
|
||||
let hl = line_to == line ? e['to'] - line2byte(line_to) + 1 : 0
|
||||
else
|
||||
let line = 0
|
||||
let column = 0
|
||||
let hl = 0
|
||||
endif
|
||||
|
||||
if column < 0
|
||||
let column = 0
|
||||
endif
|
||||
if hl < 0
|
||||
let hl = 0
|
||||
endif
|
||||
|
||||
call add(out,
|
||||
\ e['file'] . ':' .
|
||||
\ e['severity'][0] . ':' .
|
||||
\ line . ':' .
|
||||
\ column . ':' .
|
||||
\ hl . ':' .
|
||||
\ e['message'])
|
||||
catch /\m^Vim\%((\a\+)\)\=:E716/
|
||||
call syntastic#log#warn('checker javascript/tern_lint: unrecognized error item ' . string(e))
|
||||
let out = []
|
||||
endtry
|
||||
endfor
|
||||
else
|
||||
call syntastic#log#warn('checker javascript/tern_lint: unrecognized error format')
|
||||
endif
|
||||
|
||||
echomsg string(out)
|
||||
return out
|
||||
endfunction " }}}2
|
||||
|
||||
function! syntastic#preprocess#tslint(errors) abort " {{{2
|
||||
return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")')
|
||||
endfunction " }}}2
|
||||
|
6931
sources_non_forked/syntastic/doc/syntastic-checkers.txt
Normal file
6931
sources_non_forked/syntastic/doc/syntastic-checkers.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -76,9 +76,7 @@ syntax checker plugins are defined on a per-filetype basis where each one wraps
|
||||
up an external syntax checking program. The core script delegates off to these
|
||||
plugins and uses their output to provide the syntastic functionality.
|
||||
|
||||
Take a look at the wiki for a list of supported filetypes and checkers:
|
||||
|
||||
https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers
|
||||
Take a look at the list of supported filetypes and checkers: |syntastic-checkers|.
|
||||
|
||||
Note: This doc only deals with using syntastic. To learn how to write syntax
|
||||
checker integrations, see the guide on the GitHub wiki:
|
||||
@ -563,7 +561,7 @@ option should be set to something like: >
|
||||
\ "file:p": ['\m^/usr/include/', '\m\c\.h$'] }
|
||||
<
|
||||
Each element turns off messages matching the patterns specified by the
|
||||
corresponding value. Values are lists, but if a list consist of a single
|
||||
corresponding value. Values are lists, but if a list consists of a single
|
||||
element you may omit the brackets (e.g. you may write "style" instead of
|
||||
["style"]). Elements with values [] or "" are ignored (this is useful for
|
||||
overriding filters, cf. |filter-overrides|).
|
||||
@ -751,10 +749,8 @@ If neither |'g:syntastic_<filetype>_checkers'| nor |'b:syntastic_checkers'|
|
||||
is set, a default list of checker is used. Beware however that this list
|
||||
deliberately kept minimal, for performance reasons.
|
||||
|
||||
Take a look at the wiki to find out what checkers and filetypes are supported
|
||||
by syntastic:
|
||||
|
||||
https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers
|
||||
Take a look elsewhere in this manual to find out what checkers and filetypes
|
||||
are supported by syntastic: |syntastic-checkers|.
|
||||
|
||||
Use `:SyntasticInfo` to see which checkers are available for a given filetype.
|
||||
|
||||
@ -848,9 +844,8 @@ omitting the filename from the command line: >
|
||||
*syntastic-config-no-makeprgbuild*
|
||||
For checkers that do not use the "makeprgBuild()" function you will have to
|
||||
look at the source code of the checker in question. If there are specific
|
||||
options that can be set, they are normally documented in the wiki:
|
||||
|
||||
https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers
|
||||
options that can be set they are normally documented in this manual (see
|
||||
|syntastic-checkers|).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
5.4 Sorting errors *syntastic-config-sort*
|
||||
|
@ -19,7 +19,7 @@ if has('reltime')
|
||||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.7.0-144'
|
||||
let g:_SYNTASTIC_VERSION = '3.7.0-153'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
@ -17,7 +17,6 @@ let g:loaded_syntastic_cpp_clang_check_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_check',
|
||||
\ 'exec': 'clang-check',
|
||||
\ 'redirect': 'c/clang_check'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -17,7 +17,6 @@ let g:loaded_syntastic_cpp_clang_tidy_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'clang_tidy',
|
||||
\ 'exec': 'clang-tidy',
|
||||
\ 'redirect': 'c/clang_tidy'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -18,7 +18,6 @@ let g:loaded_syntastic_cpp_pc_lint_checker = 1
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'pc_lint',
|
||||
\ 'exec': 'lint-nt',
|
||||
\ 'redirect': 'c/pc_lint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -0,0 +1,53 @@
|
||||
"============================================================================
|
||||
"File: tern_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047@gmail.com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_javascript_tern_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_tern_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_javascript_tern_lint_IsAvailable() dict
|
||||
return has('byte_offset') && executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_tern_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
||||
let errorformat = '%f:%t:%l:%c:%n:%m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'preprocess': 'tern_lint',
|
||||
\ 'returns': [0] })
|
||||
|
||||
for e in loclist
|
||||
if get(e, 'col', 0) && get(e, 'nr', 0)
|
||||
let e['hl'] = '\%>' . (e['col'] - 1) . 'c\%<' . (e['nr'] + 1) . 'c'
|
||||
endif
|
||||
let e['nr'] = 0
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'tern_lint',
|
||||
\ 'exec': 'tern-lint' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,51 @@
|
||||
"============================================================================
|
||||
"File: sass_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_sass_sass_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_sass_sass_lint_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_sass_sass_lint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 5])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_sass_sass_lint_GetLocList() dict
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args': '-v',
|
||||
\ 'args_after': '-q -f compact' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f: line %l\, col %c\, %trror - %m,' .
|
||||
\ '%f: line %l\, col %c\, %tarning - %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sass',
|
||||
\ 'name': 'sass_lint',
|
||||
\ 'exec': 'sass-lint' })
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -0,0 +1,23 @@
|
||||
"============================================================================
|
||||
"File: sass_lint.vim
|
||||
"Description: Syntax checking plugin for syntastic
|
||||
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('g:loaded_syntastic_scss_sass_lint_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scss_sass_lint_checker = 1
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scss',
|
||||
\ 'name': 'sass_lint',
|
||||
\ 'redirect': 'sass/sass_lint'})
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -41,35 +41,37 @@ endfunction " }}}1
|
||||
" Utilities {{{1
|
||||
|
||||
function! s:GetValaModules() " {{{2
|
||||
if exists('g:syntastic_vala_modules')
|
||||
if type(g:syntastic_vala_modules) == type('')
|
||||
return split(g:syntastic_vala_modules, '\s\+')
|
||||
elseif type(g:syntastic_vala_modules) == type([])
|
||||
return copy(g:syntastic_vala_modules)
|
||||
if exists('g:syntastic_vala_modules') || exists('b:syntastic_vala_modules')
|
||||
let modules = syntastic#util#var('vala_modules')
|
||||
if type(modules) == type('')
|
||||
return split(modules, '\m\s\+')
|
||||
elseif type(modules) == type([])
|
||||
return copy(modules)
|
||||
else
|
||||
echoerr 'g:syntastic_vala_modules must be either list or string: fallback to in file modules string'
|
||||
echoerr 'syntastic_vala_modules must be either list or string: fallback to in file modules string'
|
||||
endif
|
||||
endif
|
||||
|
||||
let modules_line = search('^// modules: ', 'n')
|
||||
let modules_str = getline(modules_line)
|
||||
return split(strpart(modules_str, 12), '\s\+')
|
||||
return split(strpart(modules_str, 12), '\m\s\+')
|
||||
endfunction " }}}2
|
||||
|
||||
function! s:GetValaVapiDirs() " {{{2
|
||||
if exists('g:syntastic_vala_vapi_dirs')
|
||||
if type(g:syntastic_vala_vapi_dirs) == type('')
|
||||
return split(g:syntastic_vala_vapi_dirs, '\s\+')
|
||||
elseif type(g:syntastic_vala_vapi_dirs) == type([])
|
||||
return copy(g:syntastic_vala_vapi_dirs)
|
||||
if exists('g:syntastic_vala_vapi_dirs') || exists('b:syntastic_vala_vapi_dirs')
|
||||
let vapi_dirs = syntastic#util#var('vala_vapi_dirs')
|
||||
if type(vapi_dirs) == type('')
|
||||
return split(vapi_dirs, '\m\s\+')
|
||||
elseif type(vapi_dirs) == type([])
|
||||
return copy(vapi_dirs)
|
||||
else
|
||||
echoerr 'g:syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
|
||||
echoerr 'syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string'
|
||||
endif
|
||||
endif
|
||||
|
||||
let vapi_line = search('^//\s*vapidirs:\s*','n')
|
||||
let vapi_str = getline(vapi_line)
|
||||
return split( substitute( vapi_str, '^//\s*vapidirs:\s*', '', 'g' ), '\s\+' )
|
||||
return split( substitute( vapi_str, '\m^//\s*vapidirs:\s*', '', 'g' ), '\m\s\+' )
|
||||
endfunction " }}}2
|
||||
|
||||
" }}}1
|
||||
|
@ -67,9 +67,10 @@ function! SyntaxCheckers_vim_vimlint_GetLocList() dict " {{{1
|
||||
\ 'EVL204': 3,
|
||||
\ 'EVL205': 3 }
|
||||
|
||||
if exists('g:syntastic_vimlint_options')
|
||||
if type(g:syntastic_vimlint_options) == type({})
|
||||
let options = filter(copy(g:syntastic_vimlint_options), 'v:key =~# "\\m^EVL"')
|
||||
if exists('g:syntastic_vimlint_options') || exists('b:syntastic_vimlint_options')
|
||||
let opts = syntastic#util#var('vimlint_options')
|
||||
if type(opts) == type({})
|
||||
let options = filter(copy(opts), 'v:key =~# "\\m^EVL"')
|
||||
call extend(param, options, 'force')
|
||||
endif
|
||||
endif
|
||||
|
Reference in New Issue
Block a user