When I'm using setlocal encoding on VIM to change the buffer encoding VIM changes the encoding of all buffers. It's really annoying because I'm editing files in different encoding and I'm corrupting them all the time. I tried it by creating two buffers, did a setlocal encoding=latin1 on one, a setlocal encoding=utf-8 on the other : the encoding is always the same on the two buffers and it's always the last encoding I set.
setlocal works well on 'shiftwidth' for example, the issue only exhibits on the encoding option.
I tried to reinstall a new copy of VIM, I tried the 7.2 and 7.1, I still have the issue. I've disabled all my plugins, my vimrc.
Am I losing my mind thinking that it's the way it used to work ? Do you have some idea that might cause that ?
I'm using VIM on Windows 7 if that's important.
'encoding' is a global option that dictates how Vim treats text internally so you are two times wrong.
setlocal doesn't work for global-only options like 'encoding'.
:help 'option' tells you the "scope" of 'option'.
'encoding' is not the option you are looking for, you want :set fileencoding=utf-8.
Reference:
:help 'encoding'
:help 'fileencoding'
:help 'setlocal'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With