Sunday, November 25, 2012

Re: change the filetype

On Sunday, November 25, 2012 5:54:34 PM UTC-5, Gary Johnson wrote:
> On 2012-11-25, cyboman wrote:
>
> > I have a certain set of settings for cpp files. All those settings
>
> > are located in ~/.vim/after/ftplugin/cpp.vim
>
> >
>
> > I would like to apply those settings to c files as well. I tried
>
> > to put the following code into ~/.vim/after/ftplugin/c.vim
>
> >
>
> > set filetype=cpp
>
> >
>
> > but I got the error saying that the nesting is too deep.
>
>
>
> I think all you need to do is rename your cpp.vim file to c.vim
>
> because $VIMRUNTIME/ftplugin/cpp.vim executes runtime on
>
> ftplugin/c.vim. Therefore your c.vim file will be used by both c
>
> and cpp filetypes.
>
>
>
> Regards,
>
> Gary

Thanks Garry. I put my code in ~/.vim/after/ftplugin/c.vim

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

Post a Comment