how to load vim source files based on filetype?

5 views
Skip to first unread message

Peng Yu

unread,
Nov 27, 2008, 8:50:45 PM11/27/08
to vim_use
Hi,

I have vim-latex, perl.vim and bash-support.vim installed. I see menu
items for latex, perl and bash, no matter what the file type is. I'm
wondering if it is possible to configure vim so that it would not load
them if the file type does not match.

http://vim-latex.sourceforge.net/
http://www.vim.org/scripts/script.php?script_id=56
http://www.vim.org/scripts/script.php?script_id=365

Thanks,
Peng

Tony Mechelynck

unread,
Nov 28, 2008, 8:23:42 AM11/28/08
to vim...@googlegroups.com

Gvim normally loads its menus once and for all, at startup (normally as
a result of "filetype plugin [indent] on" IIRC), but plugins may modify
the menus, and if you use "Syntax => Show filetypes in menu" the menus
will be reloaded.

However, what you're asking for would require unloading and reloading
the menus whenever one moves from one split-window to another (since the
files in different split-windows may have different filetypes). It
/might/ be possible to do it by modifying your plugins, but I don't
think the game would be worth the candle.


Best regards,
Tony.
--
GALAHAD turns back. We see from his POV the lovely ZOOT standing by
him smiling enchantingly and a number of equally delectable GIRLIES
draped around in the seductively poulticed room. They look at him
smilingly and wave.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

Peng Yu

unread,
Nov 28, 2008, 8:42:54 PM11/28/08
to vim_use


On Nov 28, 7:23 am, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:
> On 28/11/08 02:50, Peng Yu wrote:
>
> > Hi,
>
> > I have vim-latex, perl.vim and bash-support.vim installed. I see menu
> > items for latex, perl and bash, no matter what the file type is. I'm
> > wondering if it is possible to configure vim so that it would not load
> > them if the file type does not match.
>
> >http://vim-latex.sourceforge.net/
> >http://www.vim.org/scripts/script.php?script_id=56
> >http://www.vim.org/scripts/script.php?script_id=365
>
> > Thanks,
> > Peng
>
> Gvim normally loads its menus once and for all, at startup (normally as
> a result of "filetype plugin [indent] on" IIRC), but plugins may modify
> the menus, and if you use "Syntax => Show filetypes in menu" the menus
> will be reloaded.
>
> However, what you're asking for would require unloading and reloading
> the menus whenever one moves from one split-window to another (since the
> files in different split-windows may have different filetypes). It
> /might/ be possible to do it by modifying your plugins, but I don't
> think the game would be worth the candle.

I do not really need to switch between different menu if I switch
between different menus.

Suppose I only start one file, I just want the menu associated with
its filetype be loaded to speedup the loading.

Thanks,
Peng
Reply all
Reply to author
Forward
0 new messages