About: Automatic insertion of C/C++ header gates   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Placing the following snippet in your vimrc file, makes Vim insert these preprocessor gates automatically, when a new header file is created: function! s:insert_gates() let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g") execute "normal! i#ifndef " . gatename execute "normal! o#define " . gatename . " " execute "normal! Go#endif /* " . gatename . " */" normal! kk endfunction autocmd BufNewFile *.{h,hpp} call insert_gates()

AttributesValues
rdfs:label
  • Automatic insertion of C/C++ header gates
rdfs:comment
  • Placing the following snippet in your vimrc file, makes Vim insert these preprocessor gates automatically, when a new header file is created: function! s:insert_gates() let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g") execute "normal! i#ifndef " . gatename execute "normal! o#define " . gatename . " " execute "normal! Go#endif /* " . gatename . " */" normal! kk endfunction autocmd BufNewFile *.{h,hpp} call insert_gates()
Version
  • 5(xsd:double)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 510(xsd:integer)
Category
  • Templates
  • C
  • C++
Author
  • Morten Fjord-Larsen
Complexity
  • basic
Created
  • 2003-07-21(xsd:date)
ID
  • 514(xsd:integer)
NEXT
  • 515(xsd:integer)
Rating
  • 63(xsd:integer)
abstract
  • Placing the following snippet in your vimrc file, makes Vim insert these preprocessor gates automatically, when a new header file is created: function! s:insert_gates() let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g") execute "normal! i#ifndef " . gatename execute "normal! o#define " . gatename . " " execute "normal! Go#endif /* " . gatename . " */" normal! kk endfunction autocmd BufNewFile *.{h,hpp} call insert_gates()
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software