autocmd to recognise encoding by file name?

7 views
Skip to first unread message

yecril

unread,
Nov 14, 2010, 6:11:04 PM11/14/10
to vim_multibyte
Apache httpd officially sets charset of .latin2.html files to
ISO-8859-2 [1], and so should vim.

au BufNewFile,BufReadPre *.latin2.html :e ++enc=latin2

That is the idea, although I do not know whether it is correct, where
to put it, how to handle file read/write and the like. The same
applies to other supported encodings as well. Also, no idea how to
handle multiple extensions; it seems that httpd actually
prefers .html.latin2 because of MultiViews (selecting candidate
sources on the fly).

[1] <URL: file:///etc/apache2/mod_mime-defaults.conf >
Reply all
Reply to author
Forward
0 new messages