I've implemented some advanced kind of filetype handling:
You have different features (commands, mappings, completion functions)
which you want to assign to some buffers:
Mappings like this can be tagged (eg tag "vim" and "help")
map <leader>Help :call ShowHelp()<cr>
You than add all features belonging to a tag to the buffer:
BufferFeatureTags help
or
BufferFeatureTags vim
or both:
BufferFeatureTags vim help
So far its nice. It's not much different from
runtime */ftplugin/help*.vim | runtime */ftplugin/vim*.vim
However you can remove them again easily:
BufferFeatureTags -vim -help
and the mappings and commands are gone.
I guess you've already noticed that there must be a
GlobalFeatureTag
command as well. There is :-)
I've only tested the global features yet. I'll test buffer features when
I need them.
The code can be found within the TOVL library.
You can define such mappings or commands similar to this example taken
from core/autoload/plugins/language_support/haskell.vim
call self.RegI({
\ 'lhs' : self.cfg.lhs_compile,
\ 'rhs' : '<esc>:call '. self.s
.'.NewCompileProcess().RunInBackground()<cr>',
\ 'tags' : ['haskell']
\ })
Enjoy and join!
Marc Weber
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---