Solution to Chinese garbled characters using vim (vi) in Linux
Add the following two lines in the ~/.vimrc file:
set encoding=utf-8 set fileencoding=utf-8
Then the encoding in secureCRT is also set to utf- 8's. Just keep them consistent.
If you are using other terminal software, then also find the encoding settings and set it to utf-8.
Note: If there is no .vimrc file in the current user's root directory, create a new one and add the above two lines of configuration.
Modifying the .vimrc file in the current user's root directory is only valid for the current user. Modifying the /etc/vimrc file modifies the global configuration and is valid for all users. However, the prerequisite for modification is that you have modification permissions. .
The above is the detailed content of Solve the problem of Chinese garbled characters when using vim (vi) in Linux. For more information, please follow other related articles on the PHP Chinese website!