When you see lots of binary characters in Vim, you should be careful that you are editing your files correctly and not corrupting anything. It is unusual to deal with text files that have a large number of binary characters.
Are you trying to edit a binary file? You should set Vim’s 'binary'
option before loading the file (or start with vim -b
) otherwise Vim will translate newline characters and perform other undesired conversions.
Are you editing a text file that has the wrong newlines? A symptom of this is ^M
or ^J
characters appearing at the end of your lines. Explore the 'fileformat'
and 'fileformats'
options in order to help Vim save the files with the proper newlines. If you are using version control, you can instruct it to convert newlines to and from your platform so that everyone is happy.
Do you see lots of ^@
(null) characters? Maybe this file is encoded in UTF-16 and Vim isn’t decoding it properly. Reload it with :e ++enc=utf-16
, for example.
To see what value a character represents, position the cursor over it and type ga
.