Home  >  Q&A  >  body text

vim in cmder under win. The Chinese characters are garbled. I tried various solutions on Baidu... but still can't get it right.

1.As described in the title

迷茫迷茫2712 days ago1263

reply all(4)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 16:36:18

    Edit the .vimrc file in the user directory. If it does not exist, create a new one and write the following content:

    set encoding=utf-8
    set fileencodings=utf-8,chinese,latin-1
    if has("win32")
        set fileencoding=chinese
    else
        set fileencoding=utf-8
    endif
    "解决菜单乱码
    source $VIMRUNTIME/delmenu.vim
    source $VIMRUNTIME/menu.vim
    "解决consle输出乱码
    language messages zh_CN.utf-8

    Then the most important thing, cmder new command line option Powershell 不要用 cmd
    The system's cmd vim is good, but it doesn't work in cmder. I tried Powershell and found that there is no garbled code.
    I am win7 and Powershell is 4.0

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 16:36:18

    Do you have any screenshots? Tell me how you configured it?

    reply
    0
  • 迷茫

    迷茫2017-05-16 16:36:18

    Is there a solution? I use the vi that comes with cmder

    The above is useless. Shift + alt + 2 opens the file and it still has garbled characters.

    ]

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 16:36:18

    settings->Environment->Add set LANG=zh_CN.UTF-8

    reply
    0
  • Cancelreply