I’ve got this in .vim/ftplugin/html.vim:
set makeprg=%!tidy\ -q\ -i\ --show-warnings\ no
If I do make in a html file I get this error:
E499: Empty file name for '%' or '#', only works with ":p:h"
When I execute this:
:%!tidy -q -i --show-warnings no
It works beautifully. What am I doing wrong with my set makeprg?
I don’t think
makeprgwas intended to be used that way. I suggest you simply define your own mapping or command%!replaces the contents of the buffer with the output of the following command, but when calling:make, the%is replaced with the file name for the current buffer. The error comes, because your current buffer is not editing a file, so the%replacement can’t take place.