Vim Modified text encoding

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.