开发者

How to completely turn off vim's abilty to recode files?

Every encodings 开发者_运维技巧related question I've found is about how to recode files.

However, mine is quite contrary one - is it possible to make vim not to recode files at all? (and how, if so?)

Sometimes it is writing [converted] at the status line, and always miss. However, I have my terminal set at the same encoding as edited file, so, I don't need no recoding at all.


Use

vim -b "myfile.type"

to edit in binary mode. You can also set

:set binary

or if you're lazy like me

:se bin

before editing a file in vim (applies to the current buffer)

: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.


If you are editing binary files you want what sehe suggests, binary.

If you're editing text files, then you probably need to change fileencodings, or if the problem is that vim hasn't detected the terminal encoding correctly, encoding.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜