The type should be python.hom
So, if I am not wrong, your file will be first of type python and then of
type hom. So you can have your stuff for python files and then your stuff
for hom files that will be executed after the python filetype statemets.
For instance I can have a
filetype/hom.vim
Whith mystuff for hom files, these statemens will be executed after the
python.vim.
So I can modify my syntax highlighting for example, only for python files
that include the module called hou.
Your function could work, I will give it a try tomorrow.
thanks

2010/6/9 AK <[email protected]>

>  On 06/09/2010 02:52 PM, Pablo Giménez wrote:
> > Thanks, I know about this solution.
> > But the problem is that I need it to be dynamic, so filetype selection
> > should be when the file is loaded
>
>
> Then something like this (untested):
>
> fun! SetHom()
>     if (search("import hou") != 0)
>         :set ft=pythonhom
>     endif
>
> :au BufRead,BufEnter *.py :call SetHom()<CR>
>
> But then switching to .py files may be sluggish. Maybe best to go to
> first line and then do this search since import will be on top.
>
> -ak
>
> --
> python plugins for vim: http://lightbird.net/pysuite/
>
>
>  --
> You received this message from the "vim_use" 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
>



-- 
Un saludo
Best Regards
Pablo Giménez

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

Reply via email to