加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何完全关闭vim的重新编码文件?

发布时间:2020-12-16 01:45:45 所属栏目:安全 来源:网络整理
导读:我发现的每个与编码相关的问题都是关于如何重新编码文件. 然而,我的相反 – 我是否有可能让vim根本不重新编码文件? (以及如何,如果是这样?) 有时它在状态行写[转换],总是错过.但是,我的终端设置与编辑文件的编码相同,因此,我根本不需要重新编码. 解决方法
我发现的每个与编码相关的问题都是关于如何重新编码文件.

然而,我的相反 – 我是否有可能让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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读