Similar apologies if this response starts from 0 assumptions :)

1: You're opening up a .m, .h, .c, .cpp, .cxx, etc. file, right?  You can't
open up compiled programs in MacVim (so things in /Applications aren't
likely to be useful to open).

2: Do you know what Unicode is?  ^@ usually indicates a NULL byte, which
UTF-16 inserts to pad characters to 16 bits.  If the file looks like the
expected C code, but there's just ^@ in-between each character, this is
what's happening.  For portability, I don't recommend storing code in
UTF-16; you should probably use UTF-8 or a non-unicode file format, but
that's not directly related to the current issue :).  You can try this, to
see if it loads in utf 16:
:e ++enc=utf16 path/to/file.c

3: I don't know if vim does automatic byte-order determination, so if the
suggestion from #2 doesn't work (the file looks like a bunch of chinese
characters with random symbols throughout), also give this a shot:
:e ++enc=utf16le path/to/file.c

If you determine it's in utf-16 and it loads and shows fine in vim with the
above option, I think that you can have vim save it as utf-8 (so that you
don't need to worry about it anymore) for you by running:
:save ++enc=utf8 new/path/to/file.c


On Mon, Nov 28, 2011 at 11:40 AM, Pete T <pturne...@googlemail.com> wrote:

> Hey there.
>
> Apologies if this is an extremely basic question, but I've begun
> learning C using MacVim and I think it's brilliant. However, when I
> load up programs, instead of appearing as code, it is showing up as
> non-sensical (I think) letters, and @^@^@^@^@^@^ in blue. I've not
> been able to find any other topic on this from what basic terms I
> know.
>
> Any help would be wonderful.
>
> Thanks,
> Peter.
>
> --
> You received this message from the "vim_mac" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>

-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to