Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the vim encoding format

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to configure vim coding format". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

View file encodings in Vim

: set fileencoding

You can display the file encoding format. If you just want to view files in other encoding formats or want to solve the problem of viewing garbled files with Vim, add the following to the ~ / .vimrc file:

Set encoding=utf-8 fileencodings=utf-8

In this way, you can let vim automatically identify the file encoding (can automatically identify UTF-8 or GBK encoded files), in fact, according to the coding list provided by fileencodings to try, if you do not find a suitable encoding, use latin-1 (ASCII) coding to open. Open a file in a specified encoding, such as a file saved in ANSI in windows

Vim file.txt-c "e + + enc=GB18030"

File coding conversion

Convert file encoding directly in Vim, such as converting a file to utf-8 format

: set fileencoding=utf-8

View file format

: set fileformat# or: set ff

Set the file format to unix

: set fileformat=unix# or: set ff=unix "how to configure the vim encoding format" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report