WillxD
WillxD

Reputation: 200

MacVim shows strange characters "^@" at the end of files

I have a problem editing files from my server. Every time I open a file, macvim shows strange characters at the end of the file. Something like this: "^@^@^@^@^@^@^@^@"

I've tried deleting these strange characters, but they appear every time I open the file again.

These characters only appear when I edit files of an external server.

Here is a screenshot of the problem. http://d.pr/mAbR

Anybody knows how can I fix it?

Regards,

Will

Upvotes: 1

Views: 648

Answers (1)

ewh
ewh

Reputation: 1024

The ^@ in Vim usually indicates the existence of null bytes in the data.

You should provide some more clarification of what you mean by "external server". I.e. Are you editing the files over a network mount, are you remote logging into the server and running vim on it, or are you transfering the files to your local system before editing.

Try using another program to read the file to see if the null bytes are present in the actual data or if it is macvim-only problem.

If you have the command 'od' on your system, you can use it on the file to see if it indicates the existence of null bytes in the data. Something like 'od -c [file]' should work. This will generate a ASCII-based dump of the file.

Upvotes: 4

Related Questions