How can I check HTML5 directly in Vim?

Of course, you can use the old old online tools such as the W3C Validator, but I think it would be more efficient to check directly in Vim.

I tried a built-in HTML check plugin called "Syntax", which defaulted to HTML Tidy. Although this seems to work, I found out that HTML Tidy does not actually support HTML5, and the solution looks more like a hack. Please let me know if I am wrong.

However, I also found a rather old article about using an online service in Vim:

http://blog.whatwg.org/vim-checker

Although this hasn’t worked for me yet, I think you can make it work with Syntastic.

Last but not least, I checked the Internet for some applications on the command line, and that’s all I found:

http://about.validator.nu/html5check.py

A script that uploads a file to the same online service and displays errors on the command line.

Do any of you know if I can even make this script work with syntax or Vim in general? Or does anyone know a different solution? A walkthrough would be really cool.

thanks in advance

+3
source share
3 answers

UPDATE: the best solution for me was the following:

Download this script, make it executable, and put it in your path.

http://about.validator.nu/html5check.py

Then add this to you vimrc:

"check html
map ,h5 :!html5check %<CR>

You do not need to read the rest.


Wow, suddenly it worked, and I thought, why not right away ...

Vim, :

  • Syntastic
  • [Syntastic plugin folder]/syntax_checkers/html.vim
  • "let makeprg=..." "let errorformat=..."

  • let makeprg="html5check ".shellescape(expand('%'))

    let errorformat='%m'

, .

  1. , , :

    http://about.validator.nu/html5check.py

  2. , opt/local/bin. .

, -.

+3

ALE Lint Vim, IDE- Vim-:

https://github.com/w0rp/ale#1-supported-languages-and-tools

HTML - , , , HTML- .

0

All Articles