Is it possible to automatically set UTF16 file encoding when opening a file of that type?

前端 未结 3 1268
南笙
南笙 2020-12-24 12:30

I edit all kinds of files with Vim (as I\'m sure most Vim users do). One bug bear I have is what Vim does when I come across a file with an odd encoding. Most editors (the

3条回答
  •  粉色の甜心
    2020-12-24 13:08

    Adding the encoding name to 'fileencodings' should do the trick:

    :set fencs=ucs-bom,utf-16le,utf-8,default,latin1
    

    Alternatively, there are plugins like AutoFenc and fencview.

提交回复
热议问题