sponsor Vim development Vim logo Vim Book Ad

headerguard : Add header guards to C/C++ header files

 script karma  Rating 25/12, Downloaded by 1838  Comments, bugs, improvements  Vim wiki

created by
Michael Henry
script type
Headerguard -  Add header guards to C/C++ header files

It is a common practice to insert header guards into C/C++ header files to
allow a header to be included multiple times.  A header guard for file
HeaderName.h typically looks something like this::

  #ifndef HEADERNAME_H
  #define HEADERNAME_H

    ...header content...

  #endif /* HEADERNAME_H */

Headerguard provides methods for inserting and updating header guards, and for
tailoring the header guard style to fit local conventions.  It checks for a
pre-existing header guard, and if found, modifies the existing guard in-place.

See documentation in doc/headerguard.txt for installation, customization, and
usage instructions.

Developed by Michael Henry (vim at drmikehenry.com).

Distributed under Vim's license.

Git repository:   https://github.com/drmikehenry/vim-headerguard
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
headerguard-0.2.2.zip 0.2.2 2015-04-30 7.0 Michael Henry Add g:headerguard_use_cpp_comments to use C++ comments in #endif (thanks to Péter Szabados).
headerguard-0.2.1.zip 0.2.1 2013-10-03 7.0 Michael Henry Documentation reorganization.
headerguard-0.2.0.zip 0.2.0 2013-10-03 7.0 Michael Henry - Convert to bundle-based installation.
- Allow for buffer-local overrides of global guard definitions.
headerguard-0.1.1.zip 0.1.1 2013-09-24 7.0 Michael Henry Properly restore cpoptions.
headerguard-0.1.0.zip 0.1.0 2007-09-14 7.0 Michael Henry Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.