Autocommands: 'setfiletype' and 'e ++enc=cp866'
- Hello, Antoine!
Saturday, March 29, 2003, you wrote to me:
>> au BufRead golded.msg setf mail | silent execute 'edit ++enc=cp866'AJM> What happens if you omit the :exe 'edit ++enc=cp866' altogether?
>> After restarting VIM and opening 'golded.msg' it was found, that
>> file was opened with fileencoding set to 'cp866' and filetype set to
>> 'mail'. But the file is not 'colorized' at all.
>> The file opens colorized if I change the aforementioned 'au'-line
>> like this:
>> au BufRead golded.msg silent execute 'edit ++enc=cp866' | setf mail
AJM> If the file is colorized in that case, it means :e ++enc=cp866 removes the
AJM> highlighting; if it isn't, it means the highlight groups were not identified
AJM> when Vim thought the file was in a different encoding.
Yes, when there is only 'au BufRead golded.msg setf mail', the file is
colirized properly. When I add '++enc' stuff: 'au BufRead golded.msg
setf mail | silent execute edit ++enc=cp866' - the file is not
colorized at all. But if I execute this command: 'set syntax?' I'll
receive 'mail' answer.
The highliting of files is not removed if I just execute ":e
++enc=xxx" from command line. This happens only when it was executed
So the question is - _why_ ':exe edit ++enc=xxx' removes the
highlighting, when executed from autocommand? Is this normal?
http://www.nbk.orc.ru (Ne Bey Kopytom)
http://www.nbk.orc.ru/mtb (MTB riding in Moscow)
PGP key: mailto:pgp-public-keys@...?subject=GET%20strauss@...
np: Space Safari - Be Alright (Soul)