我发现的每个与编码相关的问题都是关于如何重新编码文件.
然而,我的相反 – 我是否有可能让vim根本不重新编码文件? (以及如何,如果是这样?)
有时它在状态行写[转换],总是错过.但是,我的终端设置与编辑文件的编码相同,因此,我根本不需要重新编码.
解决方法
使用
vim -b "myfile.type"
以二进制模式编辑.你也可以设置
:set binary
或者如果你像我一样懒惰
:se bin
在vim中编辑文件之前(适用于当前缓冲区)
:he `binary` *'binary'* *'bin'* *'nobinary'* *'nobin'* 'binary' 'bin' boolean (default off) local to buffer {not in Vi} This option should be set before editing a binary file. You can also use the |-b| Vim argument. When this option is switched on a few options will be changed (also when it already was on): 'textwidth' will be set to 0 'wrapmargin' will be set to 0 'modeline' will be off 'expandtab' will be off Also,'fileformat' and 'fileformats' options will not be used,the file is read and written like 'fileformat' was "unix" (a single <NL> separates lines). The 'fileencoding' and 'fileencodings' options will not be used,the file is read without conversion.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。