How to use tidy with vim without unix linebreak in quickfix window and how to correct only the errors? -
after lot of searching , trying found make tidy work vim:
:set makeprg=tidy\ -e\ --gnu-emacs\ yes :set shellpipe=2> :set errorformat=%f:%l:%c:\ %m :make % :copen
but why output in quickfix window has ^m
unix line-break @ end of every line? tried remove content in quickfix window not modifiable.
i tried make tidy correct errors, errors.
i created this:
let errorf = "d:\\error.txt" let currentf = expand("%:p") let writef = "d:\\".expand("%:t:r")."_tidy.".expand("%:e") exe a:type."!tidy -w 0 -f ".errorf." -o ".writef." ".currentf exe ":bot split ".writef exe ":bot split ".errorf
but changes complete output of file. want correct errors. have read manual of tidy can't find simple option correct errors without changing rest of file. p.e.
<h1>test</h2> --> <h1>test</h1>
are there tidy users know how change errors in tidy?
you can pipe output of tidy sed create filter remove carriage returns before vim puts in quickfix window.
set makeprg=tidy\ -e\ --gnu-emacs\ yes\ $*\ \\\|\ sed\ 's/\\r$//'
the pipe needs escaped twice 1 set , once interpretation of command.
the sed command used was
sed 's/\r$//
which removes carriage returns appear @ end of line.
Comments
Post a Comment