> You can override or preempt what the distribution does in
> $VIMRUNTIME/filetype.vim by creating your own ~/.vim/filetype.vim
> file (or ~/vimfiles/filetype.vim on Windows).
I know that, but I'm writing a plugin. Something that might live, e.g., in
~/.vim/pack/me/opt/pollen/{ftdetect,ftplugin}/pollen.vim.
> That might work
> better than trying to reset did_filetype(). You could treat *.md.pp
> files specially that way. Or do your own extended handling of *.pp
> files.
>
It's got to be all *.pp, esp. those with two extensions.
> The answer may be as simple as using ":set ft" instead of ":setf" in
> your plugin. You can also do things like put ":runtime
> ftplugin/markdown.vim" in your ftplugin to source all the
> distribution's ftplugin files for your filetype. See, for example:
>
> $VIMRUNTIME/ftplugin/cpp.vim
> $VIMRUNTIME/ftplugin/docbk.vim
>
This won't work without re-inventing all of vim's filetype detection
mechanisms, which is what I want to avoid with the execute 'doautocommand
…' line. Why? Because the filetype to use heavily depends on the base
filename, sans .pp extension.
> I don't have a concrete answer because I don't understand exactly
> what you're trying to do. Also, I'm no expert in Vim's handling of
> filetypes. Generally I've found that Vim has the hooks to do what
> you want, but it may take some study and tinkering and rethinking of
> your initial solution to get the results you want.
>
My current "hack" works—I just hoped there was a better way. I haven't even
noticed any screen issues, since I don't think anything is drawn until
after the whole sequence completes. I do wonder if this could disturb
window sizing though.
--
--
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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/a05ab958-7e96-4dc1-af0b-c367ca98ac8fn%40googlegroups.com.