About: Highlight debug blocks in programs   Sponge Permalink

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

and you would like to highlight these segments in a different colour (so that you can skip them visually), add the following code in your .vimrc (colouring follows that of comments) syn region MySkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=MySkip let g:CommentDefines = "" hi link MyCommentOut2 MyCommentOut hi link MySkip MyCommentOut hi link MyCommentOut Comment map ,a :call AddCommentDefine() map ,x :call ClearCommentDefine() function! AddCommentDefine() let g:CommentDefines = "\\(" . expand("") . "\\)" syn clear MyCommentOut syn clear MyCommentOut2 exe 'syn region MyCommentOut start="^\s*#\s*ifdef\s\+' . g:CommentDefines . '\>" end=".\|$" contains=MyCommentOut2' exe 'syn region MyCommentOut2 contained start="' . g:CommentDefine

AttributesValues
rdfs:label
  • Highlight debug blocks in programs
rdfs:comment
  • and you would like to highlight these segments in a different colour (so that you can skip them visually), add the following code in your .vimrc (colouring follows that of comments) syn region MySkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=MySkip let g:CommentDefines = "" hi link MyCommentOut2 MyCommentOut hi link MySkip MyCommentOut hi link MyCommentOut Comment map ,a :call AddCommentDefine() map ,x :call ClearCommentDefine() function! AddCommentDefine() let g:CommentDefines = "\\(" . expand("") . "\\)" syn clear MyCommentOut syn clear MyCommentOut2 exe 'syn region MyCommentOut start="^\s*#\s*ifdef\s\+' . g:CommentDefines . '\>" end=".\|$" contains=MyCommentOut2' exe 'syn region MyCommentOut2 contained start="' . g:CommentDefine
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 638(xsd:integer)
Category
  • C
  • C++
Text
  • ifdef plugin
Author
  • Karthick Gururaj
Complexity
  • basic
Created
  • 2004(xsd:integer)
ID
  • 7(xsd:integer)
  • 639(xsd:integer)
NEXT
  • 640(xsd:integer)
Rating
  • 8(xsd:integer)
abstract
  • and you would like to highlight these segments in a different colour (so that you can skip them visually), add the following code in your .vimrc (colouring follows that of comments) syn region MySkip contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=MySkip let g:CommentDefines = "" hi link MyCommentOut2 MyCommentOut hi link MySkip MyCommentOut hi link MyCommentOut Comment map ,a :call AddCommentDefine() map ,x :call ClearCommentDefine() function! AddCommentDefine() let g:CommentDefines = "\\(" . expand("") . "\\)" syn clear MyCommentOut syn clear MyCommentOut2 exe 'syn region MyCommentOut start="^\s*#\s*ifdef\s\+' . g:CommentDefines . '\>" end=".\|$" contains=MyCommentOut2' exe 'syn region MyCommentOut2 contained start="' . g:CommentDefines . '" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=MySkip' endfunction function! ClearCommentDefine() let g:ClearCommentDefine = "" syn clear MyCommentOut syn clear MyCommentOut2 endfunction To see the effect, position the cursor on the word DEBUG in the C code snippet above and type ,a
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