views:

87

answers:

2

I am using Vim 7.2 on WinXP. I've tired to run tidy like this:

:compiler tidy
:make
:copen

When I do :copen it shows me no errors to jump to. I've seen references that shellpipe might need to be set a specific way, but that refers to an earlier version of VIM.

How should I be using HTML-tidy with VIM, and do I need to mess with shellpipe to get it to work with WinXP?

A: 

You have to install a compiler script to be able to jump to errors. Fortunately the vim.org site contain a compiler script to tell him how to parse tidy's output.

You just have to drop it in your ~/vimfiles/compiler/ folder

Raoul Supercopter
There is already a tidy.vim there. the :make command seems to work, because it runs the !tidy commend and then says "shell returned 1" but it never shows me what the errors were.
stumbling
and using `:comp tidy`, still not working?
Raoul Supercopter
A: 

On windows, for html files I have f10 mapped to

:w<cr>:make<cr><cr>:copen<cr>

and in ~/vimfiles/after/ftplugin/html.vim

setlocal makeprg=tidy\ -quiet\ -errors\ %
setlocal errorformat=line\ %l\ column\ %v\ -\ %m 

and in my vimrc

"next / previous quickfix result
map <A-n> :cn<cr>
map <A-N> :cp<cr>

as an added bonus, once you have tidy installed, with

map <F10> V <bar> :!tidy -config ~/vimfiles/tidy_config.cfg<cr><cr>vat>

where tidy_config.cfg is

vertical-space: yes
wrap: 0
indent: auto
indent-spaces: 4
show-body-only: yes
show-warnings: no
show-errors: 0
quiet: yes
show-body-only: yes
output-xhtml: yes

you can pretty & make valid chunks of html,

dysmsyd