Hi Bram :)

 * Bram Moolenaar <[EMAIL PROTECTED]> dixit:
> DervishD wrote:
> 
> >     After that, I've set up this mappings to switch manually from
> >     one encoding to other:
> > 
> >  noremap  <silent> <Leader>+ :setlocal fenc=utf8 enc=utf8<CR>
> >  noremap  <silent> <Leader>- :setlocal fenc=latin1 enc=latin1<CR>
> > 
> >     OK, this is not a perfect solution, and it's a bit crappy and
> >     can be automated (for example, using "file -i") but it works for
> >     me and I find it very comfortable to use.
> 
> Keep in mind that when you change 'encoding' in a running Vim then all
> text in loaded buffers, registers, variables, etc. will become
> invalid. It's better to only set 'encoding' when starting up and then
> leave it alone.

    Yes, I supposed that something like that would happen, but if I
don't set 'encoding' I'm not able to see the characters correctly. I
mean, they will be correctly written to the file in utf8 but I won't be
able to see them on the screen. I know that this is risky, but the
alternative will consider all my US-ASCII files (and any newly created
one) as utf8 and I don't want that right now. For me is easier to do the
above and take the risk because I seldom edit utf8 files. If I run into
trouble, I'll probably use some "BufReadPost" autocommand to properly
set both 'encoding' and 'fileencoding'.

    Thanks for the information, Bram, and thanks a lot for Vim :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

Reply via email to