Homunculus Reticulli
Homunculus Reticulli

Reputation: 68476

C.Vim plugin, adding Automatic Header to *.h file

I have just downloaded and installed the C-Vim plugin for C/C++ development in Vim.

When I create a new .c file, a header is automatically created from a template - I want the same thing to happen when I create a new .h file.

Instead, I get the following warning (when creating new .h file):

template does not exist

How can I modify the plugin settings so that new .h files also have a template generated for them?

Upvotes: 4

Views: 2802

Answers (1)

Eric Mathison
Eric Mathison

Reputation: 1256

Add this line to your .vimrc file:

let g:C_SourceCodeExtensions  = 'h cc cp cxx cpp CPP c++ C i ii'

The important part here to notice is the h at the begining of the string. For more information on why this works see :h csupport-comm-frame.

Note: in order to see the help documentation, make sure to run :helptags ~/.vim/doc after installing the plugin. Otherwise the documentation that comes with the plugin will not be installed.

Upvotes: 4

Related Questions