View file encodings in vim
: Set fileencoding
You can display the file encoding format.
If you just want to see other encoded files or to solve the problem of using Vim to view files garbled, then
Add the following to the ~/.VIMRC file:
Set encoding=utf-8 fileencodings=utf-8
This allows vim to automatically identify the file encoding (which automatically identifies the UTF-8 or GBK encoded file), in fact, in accordance with the fileencodings provided by the encoding list to try, if not found the appropriate encoding, the latin-1 (ASCII) encoding opened.
Opens a file with the specified encoding
such as opening files in Windows that are saved in ANSI
file " e ++enc=gb18030 "
File Encoding Conversion
Convert file encoding directly into Vim, such as converting a file to Utf-8 format
: Set fileencoding=utf-8
View file formats
: Set FileFormat?
Set file format to Unix
: Set Fileformat=unix
Vim Modified text encoding