I need to run tidy in vim, using the usual:
:compile tidy :make
However, if I'm on an utf-8 file, I get errors that I don't see if I run tidy outside of vim, i.e.,
tidy -e -q -utf8
I get what I'm expecting
TIA!
I need to run tidy in vim, using the usual:
:compile tidy :make
However, if I'm on an utf-8 file, I get errors that I don't see if I run tidy outside of vim, i.e.,
tidy -e -q -utf8
I get what I'm expecting
TIA!
My Vim script skills do not go far enough to have a general solution ready, but what you can do when editing a utf-8 file:
:compiler tidy
:setlocal makeprg=<TAB> [and edit the tidy command line to include -utf8]
:make
Explanation:
":compile tidy" just executes the compiler plugin file for tidy and does setlocal to set makeprg to tidy call with some options (-q -e --gnu-emacs yes). Apparently for utf-8 files tidy needs the additional option -utf8, so you have to set this manually. Afterwards you call :make as normal.
If you are only editing utf8 files, you can of course edit the tidy compiler plugin file directly and hard code the -utf8 option to tidy there. Use the following to edit the plugin file
:e $VIMRUNTIME/compiler/tidy.vim