> Gary Johnson wrote:
>> On 2011-07-14, Linda W wrote:
>>> I've been trying to add the following -- and added to about 3 separate
>>> places
>>> and non have work:
>>>
>>> set fileencodings+=utf-16le
>> [...]
>>
>>> Anyway, with the changes in all 3 places, starting GVIM
>>> still has file encodings set to the default:
>>>
>>> fileencodings=ucs-bom,utf-8,default,latin1
>>>
>>> So What am I doing wrong?
>>>
>>> I'm pretty sure gvim reads .vimrc before .gvimrc, as I only
>>> put my vim changes in .vimrc, unless they are gui-specific (like
>>> a gui font)...and they seem to always get picked up... but it
>>> isn't picking up this change! It's like this change is being ignored.
>> I can't answer the 'fileencodings' question, but the name of the
>> personal vimrc and gvimrc files that Vim actually used should be in
>> $MYVIMRC and $MYGVIMRC, respectively. [snip]
> Tony M is the list's unquestioned expert on these matters, but as he
> hasn't had a chance to reply yet, I'll dive in.
>
> As to where your .vimrc is read, Gary J has provided good answers. You
> should do something like
> :echo $MYVIMRC
> from within vim to access these variables -- your environment (o/s)
> probably doesn't know about them.
>
> And now on to your encodings question. If your file starts with a bom, I
> believe that it is then used to tell your editor how the script is
> encoded -- IF your file happens to have one. Otherwise, the editor must
> guess. It does so by going from left to right down your fileencodings
> list. If your utf-16le encoded file doesn't happen to have a bom, then
> vim is going to try utf-8 before utf-16le, and utf-8 accepts all bytes.
> And so, vim uses utf-8.
>
> Try using
>
> set fencs=^=utf-16le (see :help :set^= )
>
> and see if that solves your difficulty.
>
> I'm ready to stand corrected whenever TonyM gets around to it!
> Chip
>
>
>
Thanks for the compliment, but most has already been said.
If Vim has read a vimrc and/or gvimrc you can find from where by asking
(in a recent-enough build)
:echo $MYVIMRC
:echo $MYGVIMRC
within Vim. (Someone did it at the shell prompt outside Vim, and got
nothing, which is expected).
You can also see all the locations where one particular Vim (if not
given a -u or -U command-line switch) looks for a vimrc or gvimrc, by
typing ":version" without the quotes and looking near the middle of the
output.
These locations can be modified at compile-time. The usual values are:
- on Unix: $HOME/.vimrc
- on Windows: $HOME/_vimrc and, if not found, $VIM/_vimrc
and in the same directories for .gvimrc or _gvimrc
$VIM/_vimrc is for single-user systems where there might not be a
meaningful $HOME setting (mostly for long obsolete versions of Windows).
Note that $VIM/vimrc without a . or _ prefix is something else: that's a
"system vimrc", added there, often misguidedly, by a sysadmin or a Linux
distro; it is sourced before your own [._]vimrc.
Note: if _vimrc is looked for, and not found, Vim will try .vimrc, and
vice-versa. Likewise (in gvim only of course) for .gvimrc and _gvimrc.
Best regards,
Tony.
--
SCCS, the source motel! Programs check in and never check out!
-- Ken Thompson
--
You received this message from the "vim_use" 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
No comments:
Post a Comment