很简单:将上面的配置追加到 ~/.vimrc 文件中;然后重新vim打开文件就可以了。
" =====================
" 多语言环境
" 默认为 UTF-8 编码
" =====================
if has("multi_byte")
set encoding=utf-8
" English messages only
"language messages zh_CN.utf-8
if has('win32')
language english
let &termencoding=&encoding
endif
set fencs=ucs-bom,utf-8,gbk,cp936,latin1
set formatoptions+=mM
set nobomb " 不使用 Unicode 签名
if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
set ambiwidth=double
endif
else
echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"
endif
本文介绍了如何在Vim编辑器中配置默认UTF-8编码,支持多语言环境,并详细列出编码设置步骤。适合初学者快速上手。

1331

被折叠的 条评论
为什么被折叠?



