How to view UTF-8 Characters in VIM or Gvim

前端 未结 9 1106
天命终不由人
天命终不由人 2020-12-12 11:01

I work on webpages involving Non-English scripts from time to time, most of them uses utf-8 charset, VIM and Gvim does not display UTF-8 Characters correctly.

Using

相关标签:
9条回答
  • 2020-12-12 11:43

    Try to reload the document using:

    :e! ++enc=utf8
    

    If that works you should maybe change the fileencodings settings in your .vimrc.

    0 讨论(0)
  • 2020-12-12 11:46

    If Japanese people come here, please add the following lines to your ~/.vimrc

    set encoding=utf-8
    set fileencodings=iso-2022-jp,euc-jp,sjis,utf-8
    set fileformats=unix,dos,mac
    
    0 讨论(0)
  • 2020-12-12 11:47

    I couldn't get any other fonts I installed to show up in my Windows GVim editor, so I just switched to Lucida Console which has at least somewhat better UTF-8 support. Add this to the end of your _vimrc:

    " For making everything utf-8
    set enc=utf-8
    set guifont=Lucida_Console:h9:cANSI
    set guifontwide=Lucida_Console:h12
    

    Now I see at least some UTF-8 characters.

    0 讨论(0)
提交回复
热议问题