search

Home  >  Q&A  >  body text

gvim - VIM error when editing BAT file, prompting "Unable to open and write the file"

As shown in the figure, 1.cmd clearly has content, but when opened by VIM, the content is empty. It seems unrecognizable. How can I edit and save directly in VIM?

The configuration of fenc.. etc. is as follows:

set encoding=utf-8
set langmenu=zh_CN.UTF-8
language messages zh_CN.UTF-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set termencoding=utf-8
set fileencoding=utf-8

:version Output result:

大家讲道理大家讲道理2743 days ago653

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-05-16 16:43:31

    My test is OK. I suspect it has something to do with the vimrc configuration. Pay attention to whether encoding, fenc, fileencodings and other encoding configurations are correct.

    reply
    0
  • Cancelreply