On Feb 17, 12:57 am, "John Beckett" <[email protected]> wrote:
> sakki wrote:
> > I often edit files which are almost C but not quite. I'd like
> > VIM to recognize them as "my_type", apply everything that is
> > done when running "set ft c", and then be able to add my own
> > extensions in ~/.vim/after/*/my_type.vim.
>
> > How do i do that?
>
> This tip has the info, although I'd like to fix it so it starts with a
> simple example showing the exact answer (which is what most people want
> to do):http://vim.wikia.com/wiki/Filetype.vim

Thanks for the link, John. However, I was not able to find the
solution for my problem from that page.

I know how to detect the filetype, but what I am missing is how to
make my new filetype almost like an existing filetype + add a few
extensions. In my case the new filetype is like C but I want to add a
few new keywords for syntax highlighting and some mappings.

Here's my current thinking how this should be done for filetype
"myType":

1) detect filetype
2) make it exactly like C
3) add new keywords for syntax highlighting
4) add new mappings

I can do everything else but 2). If I do "setf C", it breaks 3) and 4)
since the filetype is no longer "myType" but "c".

One solution is to keep the filetype as "c", and add the extensions in
after/syntax/c.vim and after/ftplugin/c.vim, but I'm looking for a
solution in which I could define a new filetype - though I don't know
whether it is possible?

--
Sami
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to