Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial import of all files.

  • Loading branch information...
commit e954e86b60c6bdfd0be940c1ec2cf4bc0fe3206b 0 parents
@sorin-ionescu authored
Showing with 73 additions and 0 deletions.
  1. +39 −0 README.md
  2. +34 −0 compiler/html.vim
39 README.md
@@ -0,0 +1,39 @@
+This is a Vim compiler plugin for validating HTML via [validator.nu](http://validator.nu "Validator.nu").
+
+Preview
+-------
+
+Screenshot:
+
+![vim-htmlvalidator](http://i.imgur.com/J0YCC.png "vim-htmlvalidator")
+
+Requirements
+------------
+
+* Vim
+* curl
+* sed
+
+Installation
+----------------------
+
+Place **html.vim** into **~/.vim/compiler** or clone this repository into the [Pathogen](https://github.com/tpope/vim-pathogen "Pathogen") **~/.vim/bundles** directory.
+
+If you wish to always associate HTML with this compiler, add the following line to the **~/.vimrc** file.
+
+`au FileType html compiler html`
+
+If you wish to automatically open the **QuickFix** window, add the following line to the **~/.vimrc** file.
+
+`au QuickFixCmdPost make cwindow`
+
+Usage
+----------------------
+
+Type **:make**. If there are errors, then type **:cwindow** or **:clist** if you have not set up the **QuickFix** window to open automatically.
+
+License
+-------
+
+GPLv2+
+
34 compiler/html.vim
@@ -0,0 +1,34 @@
+" Vim compiler file for HTML.
+" Compiler: HTML Validator
+" Maintainer: Sorin Ionescu <sorin.ionescu@gmail.com>
+" Last Change: 2010-12-04
+" Version: 1.0.0
+"
+" Installation:
+" Drop html.vim in ~/.vim/compiler directory.
+"
+" Add the following line to the autocmd section of .vimrc
+"
+" autocmd FileType html compiler html
+
+if exists('current_compiler')
+ finish
+endif
+let current_compiler = 'html'
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+ command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+"CompilerSet makeprg=(echo\ '[%]';\ curl\ -s\ --connect-timeout\ 5\ -F\ laxtype=yes\ -F\ level=error\ -F\ out=gnu\ -F\ doc=@%\ http://validator.nu\ \\\|\ sed\ -e\ \'s/^\"[^\"]*\"://g\'\ -e\ \'s/^\\([0-9]*\\)\\.\\([0-9]*\\)-[0-9]*\\.[0-9]*:/(\\1,\\2)/g\')
+"set efm=%+P[%f],(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%-Q
+
+CompilerSet makeprg=(echo\ '[%]';\ curl\ -s\ --connect-timeout\ 5\ -F\ laxtype=yes\ -F\ level=error\ -F\ out=gnu\ -F\ doc=@%\ http://validator.nu\ \\\|\ sed\ -e\ \'s/^\"[^\"]*\"://g\'\ -e\ \'s/^\\([0-9]*\\.[0-9]*\\)-[0-9]*\\.[0-9]*/\\1/g\')
+CompilerSet errorformat=%+P[%f],%l.%c:\ %t%*[^:]:\ %m,%-Q
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
Please sign in to comment.
Something went wrong with that request. Please try again.