Wednesday, November 28, 2012

Re: new filetype should extent already existing filetype

On Wed, 28 Nov 2012 14:28:47 +0100
Andy Wokula <anwoku@yahoo.de> wrote:

> Am 28.11.2012 11:04, schrieb Johannes Deutsch:
> > at the momemt I dive into gtk development and use vim to write the
> > code.
> >
> > To simplify my work i have been thinking about creating a new
> > filetype called 'c::gtk' that vim should set if a newly created
> > buffer with ft=c contains
> >
> > #include <gtk/gtk.h>
> >
> > Without the constraint 'ft=c' ut seems to be no problem to achieve
> > this specific goal since vim's help is very detailed about that (see
> > ':h new-filetype-scripts').
> >
> > Unfortunately i don't now how i should proceed, so that before
> > executing the filetype ('c::gtk') specific commands all commands of
> > the 'c'-filetype are executed.
>
> It's a less esoteric demand than you think:
> :h 'ft
>
> => create filetype scripts for "gtk", then use a modeline in your
> source files:
> /* vim:set ft=c.gtk: */
>
> :h modeline
>
> This will load ftplugin and syntax scripts for both C and gtk.
>

That's exactly what i was looking for! Thanks a lot for your answer...

best regards

--
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

No comments: