Maison > Article > développement back-end > 用vim打开后中文乱码怎么办?
<code class="language-vim"><span class="k">set</span> <span class="nb">fileencodings</span><span class="p">=</span>ucs<span class="p">-</span>bom<span class="p">,</span>utf<span class="m">-8</span><span class="p">,</span>utf<span class="m">-16</span><span class="p">,</span>gbk<span class="p">,</span>big5<span class="p">,</span>gb18030<span class="p">,</span>latin1
</code>
看到之后直接打开我本机的vimrc给你贴出来,用了2年了还没遇到乱码 <code class="language-bash"><span class="nb">set </span><span class="nv">fileencodings</span><span class="o">=</span>utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
<span class="nb">set </span><span class="nv">enc</span><span class="o">=</span>utf8
<span class="nb">set </span><span class="nv">fencs</span><span class="o">=</span>utf8,gbk,gb2312,gb18030
</code>
切换字体试一试,通常都是因为vim使用的是西文字体导致的,你把字体换成楷体试一试。