On 29/04/10 16:55, Maxim Kim wrote:
On 29 апр, 10:48, ron<[email protected]>  wrote:
I have recently started editing files with a '.wiki' extension, and
rather than getting the 'wikipedia' filetype, they pick up  the
'flexwiki' type.  That's not the problem.

The problem is that the 'flexwiki' filetype handler sets "bomb",
resulting in extra characters at the front of my utf8 files -- this
has caused problems with other software which reads those files (I
never have 'bomb' set).

Scanning the ftplugins, it seems 'flexwiki' is the only one which sets
'bomb'.  Is it an ok thing for it to do?  Also, why is "flexwiki" the
handler, when wikipedia is probably the most widely used wiki?  But
that's a quibble.

I had the very same problem with it.

Check 
http://groups.google.com/group/vim_use/browse_thread/thread/23f33912b2c0d292/90ba2a0b3a80a1fc?lnk=gst&q=flexwiki#90ba2a0b3a80a1fc

In my plugin I just do

augroup filetypedetect
   " clear FlexWiki's stuff
   au! * *.wiki
augroup end


A simpler solution would be to create a script <something>/ftplugin/flexwiki.vim with <something> being an entry which comes after $VIMRUNTIME in the 'runtimepath' option (i.e. $VIM/vimfiles/after on any platform, or also $HOME/vimfiles/after on Windows, $HOME/.vim/after on Unix), with the following contents (create the file and/or directories if they don't yet exist; append to the file if it does exist):

        setlocal nobomb

You can also override other "obnoxious" settings there in the same way if you want.

BTW, I usually have 'bomb' set myself; I clear it for files (such as anything starting with #! on its first line) which will be handled by software that doesn't know about the BOM. (At least, for HTML and, I think, CSS, the BOM is an official part of how encodings get recognized.)


Best regards,
Tony.
--
If you think last Tuesday was a drag, wait till you see what happens
tomorrow!

--
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui