diff --git a/README.markdown b/README.markdown index 4d03421..b9e08c4 100644 --- a/README.markdown +++ b/README.markdown @@ -29,14 +29,15 @@ 4.3. [Are there any local checkers for HTML5 that I can use with syntastic?](#faqhtml5) 4.4. [The `perl` checker has stopped working...](#faqperl) 4.5. [What happened to the `rustc` checker?](#faqrust) -4.6. [I run a checker and the location list is not updated...](#faqloclist) -4.6. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) -4.7. [How can I pass additional arguments to a checker?](#faqargs) -4.8. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) -4.9. [What is the difference between syntax checkers and style checkers?](#faqstyle) -4.10. [I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?](#faqaggregate) -4.11. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) -4.12. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) +4.6. [What happened to the `xcrun` checker?](#faqxcrun) +4.7. [I run a checker and the location list is not updated...](#faqloclist) +4.7. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) +4.8. [How can I pass additional arguments to a checker?](#faqargs) +4.9. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) +4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle) +4.11. [I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?](#faqaggregate) +4.12. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) +4.13. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) 5. [Resources](#otherresources) - - - @@ -51,18 +52,23 @@ 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, syntax checking plugins exist for ActionScript, -Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, -Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, 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, NASM, Objective-C, -Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and -iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, RPM -spec, Ruby, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, -Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope page templates, -and zsh. See the [wiki][3] for details about the corresponding supported -checkers. +At the time of this writing, syntastic has checking plugins for ActionScript, +Ada, API Blueprint, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, +C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, +DocBook, 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, Puppet, Python, R, Racket, Relax NG, +reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, Tcl, +TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, +YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3] for details +about the corresponding supported checkers. + +A number of third-party Vim plugins also provide checkers for syntastic, +for example: [omnisharp-vim][25], [rust.vim][12], [syntastic-extras][26], +[syntastic-more][27], [vim-crystal][29], [vim-eastwood][28], and +[vim-swift][24]. 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 @@ -183,10 +189,32 @@ 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`. -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 -create an issue - or better yet, create a pull request. +A second probable reason is that none of the available checkers are +enabled. Syntastic comes preconfigured with a default list of enabled checkers +per filetype, but this list is kept short in order to prevent slowing down Vim +or trying to run conflicting checks. The command `:SyntasticInfo` will show you +which checkers are enabled. You can tell syntastic which checkers (among the +available ones) you want to run by setting `g:syntastic__checkers` in +your `vimrc` (see [below](#faqcheckers)). + +A third possible reason is that the `$PATH` seen by syntastic might not be same +as the `$PATH` in your login shell. Syntastic runs checkers using the shell +pointed to by Vim's `shell` (or by `g:syntastic_shell`, if set), and that's the +shell you need to configure to set the proper `$PATH` and environment variables +for your checkers. You can see syntastic's idea of `$PATH` by running +```vim +:echo syntastic#util#system('echo "$PATH"') +``` +on UNIX and Mac OS-X systems, or +```vim +:echo syntastic#util#system('echo %PATH%') +``` +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. @@ -204,8 +232,10 @@ __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 in replacement, and syntastic can use it without changes. Just install it -somewhere and point `g:syntastic_html_tidy_exec` to its executable. - +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]: ```sh @@ -236,14 +266,21 @@ let g:syntastic_enable_perl_checker = 1 __4.5. Q. What happened to the `rustc` checker?__ -A. It has been included in the [Rust compiler package][12]. If you have -a recent version of the Rust compiler, the checker should be picked up -automatically by syntastic. +A. It is now part of the [rust.vim][12] plugin. If you install this plugin the +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 +install this plugin the checker should be picked up automatically by syntastic. -__4.6. Q. I run a checker and the location list is not updated...__ -__4.6. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ +__4.7. Q. I run a checker and the location list is not updated...__ +__4.7. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ A. By default the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the @@ -255,7 +292,7 @@ let g:syntastic_always_populate_loc_list = 1 -__4.7. Q. How can I pass additional arguments to a checker?__ +__4.8. Q. How can I pass additional arguments to a checker?__ A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers that do can be configured using global variables. The general form of the @@ -271,7 +308,7 @@ See `:help syntastic-checker-options` for more information. -__4.8. Q. Syntastic supports several checkers for my filetype - how do I tell it +__4.9. 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`: @@ -312,7 +349,7 @@ filetype of the current file is `php`). -__4.9. Q. What is the difference between syntax checkers and style checkers?__ +__4.10. Q. What is the difference between syntax checkers and style checkers?__ A. The errors and warnings they produce are highlighted differently and can be filtered by different rules, but otherwise the distinction is pretty much @@ -342,7 +379,7 @@ See `:help syntastic_quiet_messages` for details. -__4.10. Q. I have enabled multiple checkers for the current filetype. How can I +__4.11. Q. I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?__ A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`: @@ -354,7 +391,7 @@ See `:help syntastic-aggregating-errors` for more details. -__4.11. Q. How can I jump between the different errors without using the location +__4.12. Q. How can I jump between the different errors without using the location list at the bottom of the window?__ A. Vim provides several built-in commands for this. See `:help :lnext` and @@ -366,7 +403,7 @@ mappings (among other things). -__4.12. Q. The error window is closed automatically when I :quit the current buffer +__4.13. Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ A. There is no safe way to handle that situation automatically, but you can @@ -374,7 +411,7 @@ work around it: ```vim nnoremap :lclose:bdelete -cabbrev bd lclose\|bdelete +cabbrev bd =(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdelete' : 'bd') ``` @@ -404,18 +441,24 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. [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/ +[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://w3c.github.io/tidy-html5/ +[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