In-container operation:
- Find the .vimrc file and modify the .vimrc file.
There are usually two places to save this file:
(1) Under the /etc/ folder, it is the vim configuration of all users, which is valid for all users
(2) Under the user's home directory~ /.vimrc (may be a new directory), only valid for the current user,
then add the following lines, save it, and log in again.
set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
set enc=utf8
set fencs=utf8,gbk,gb2312,gb18030
When there is no configuration, Chinese garbled
vi ./test.sh
After the configuration of vi ~/.vimrc is completed, the Chinese garbled characters are resolved
vi ./test.sh