Merge pull request #526 from cheecheeo/master

Point out syntastic global variables earlier
This commit is contained in:
Martin Grenfell 2013-02-22 02:26:50 -08:00
commit 81e9f7aeea
2 changed files with 22 additions and 16 deletions

View File

@ -113,6 +113,18 @@ e.g. Previously there was `g:syntastic_phpcs_conf`, now you must use `g:syntasti
See `:help syntastic-checker-options` for more information. See `:help syntastic-checker-options` for more information.
__Q. How can I pass additional arguments to a checker?__
A. Almost all syntax checkers use the `syntastic#makeprg#build()` function. Those checkers that do can be configured using global variables. The general form of the global args variables are:
`syntastic_[filetype]_[subchecker]_args`
So, If you wanted to pass "--my --args --here" to the ruby mri checker you would add this line to your vimrc:
`let g:syntastic_ruby_mri_args="--my --args --here"`
See `:help syntastic-checker-options` for more information.
__Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__ __Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__
A. Stick a line like this in your vimrc: A. Stick a line like this in your vimrc:

View File

@ -316,22 +316,11 @@ found, run 'phpcs', and then 'phpmd'.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
5.2 Configuring specific checkers. 5.2 Configuring specific checkers.
Look at the checker in question. If there are specific options that can be set, Most checkers use the 'syntastic#makeprg#build()' function and provide many
these are usually documented at the top of the script. options by default - in fact you can customise every part of the command
If the checker uses the 'syntastic#makeprg#build()' function then many options
are provided by default - in fact you can customise every part of the command
that gets called. that gets called.
A makeprg has the following format: > Checkers that use 'syntastic#makeprg#build()' look like this: >
[exe] [args] [filename] [post_args] [tail]
<
e.g (this is made up) : >
ruby -a -b -c test_file.rb --more --args > /tmp/output
<
To generate this you would call: >
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'ruby', \ 'exe': 'ruby',
\ 'args': '-a -b -c', \ 'args': '-a -b -c',
@ -340,8 +329,8 @@ To generate this you would call: >
\ 'subchecker': 'mri' }) \ 'subchecker': 'mri' })
< <
All of the params above can be overriden by setting global variables - even All of the parameters above can be overriden by setting global variables -
when not specified by the checker in syntastic#makeprg#build(). even parameters not specified in syntastic#makeprg#build().
E.g. To override the checker exe above, you could do this: > E.g. To override the checker exe above, you could do this: >
let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb" let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb"
@ -355,6 +344,11 @@ The general form of the override options is: >
syntastic_[filetype]_[subchecker]_[option-name] syntastic_[filetype]_[subchecker]_[option-name]
< <
For checkers that do not use the 'syntastic#makeprg#build()' function you
will have to look at the source code of checker in question. If there are
specific options that can be set, these are usually documented at the top of
the script.
============================================================================== ==============================================================================
6. About *syntastic-about* 6. About *syntastic-about*