Display UTF-8 characters in Mac Quicklook

If you save a file using Vim or MacVim and try to open it with Quicklook, the characters will not display correctly. That is because Mac OS uses an extended attribute to determine the encoding of a file.

This will append the extended attribute in every file you save with a UTF-8. Note that % is in double quotes to escape spaces for the shell. The :silent command prevents Vim from displaying the results (which are empty).