Wednesday, April 8, 2015

Re: Syntax highlight problems

Alessandro Antonello wrote:
> Hi, Nikolay
>
> Thanks for your answer. Its a little bit strange how my brain works. I
> saw you
> version of the 'match' and I saw the solution right there. I didn't really
> need a transparent region. I just wanted that the highlighted area not
> leak to
> the start and end patterns. For that, Vim has 'hs' and 'he' pattern
> options.
> So I rewrote the region, got rid of the match and everything worked
> fine. I
> also included matches for bold, italic and code highlight in markdown
> style.
> Here they are:
>
> syn region doxygenUnderlined contained start="[\\@]uf{"hs=s+4
> end="}"he=e-1 contains=doxygenContinueComment
> containedin=doxygenBrief,doxygenBody
> syn match doxygenMarkdownCode contained /\W\@<=`[^`']*`/ms=s+1,me=e-1
> contains=doxygenContinueComment
> containedin=doxygenBrief*,doxygenLine,doxygenBody,doxygen.*Desc
> syn region doxygenMarkdownBold contained
> start="\(\w\|_\)\@<!__[^[:space:]_]"hs=s+2
> end="[^[:space:]_]__[^[:alnum:]]"he=e-3 end="[^[:space:]_]__$"he=e-2
> contains=doxygenContinueComment containedin=doxygenBrief,doxygenBody
> syn region doxygenMarkdownBold contained
> start="\(\w\|\*\)\@<!\*\*[^[:space:]*]"hs=s+2
> end="[^[:space:]*]\*\*[^[:alnum:]]"he=e-3
> end="[^[:space:]*]\*\*$"he=e-2 contains=doxygenContinueComment
> containedin=doxygenBrief,doxygenBody
> syn region doxygenMarkdownEmph contained
> start="\(\w\|_\)\@<!_[^[:space:]_]"hs=s+1
> end="[^[:space:]_]_[^[:alnum:]]"he=e-2 end="[^[:space:]_]_$"he=e-1
> contains=doxygenContinueComment containedin=doxygenBrief,doxygenBody
> syn region doxygenMarkdownEmph contained
> start="\(\w\|\*\)\@<!\*[^[:space:]*]"hs=s+1
> end="[^[:space:]*]\*[^[:alnum:]]"he=e-2 end="[^[:space:]*]\*$"he=e-1
> contains=doxygenContinueComment containedin=doxygenBrief,doxygenBody
>
> And the test:
>
> /**
> * Brief description \uf{underlined}.
> * With body @uf{underlined too}. This is _italic_ and this is __bold__.
> * Both *italic* and **bold** works as of `monospaced font`.
> *
> * And with numbers: \uf{1.4}, _1.4_ and __1.4__.
> * Every thing seams to be perfect. Separated \uf{dd
> * ddd} in lines. We can have __bold separated
> * into multiple lines__. Starred version of **bold
> * can work** on separated lines. The *starred
> * italic* also works on multiple lines.
> * Bold __()__, **{}**, __[]__ __and,__ finally **.a.**.
> * Italic _()_, *{}*, _[]_ _and,_ finally *.a.*.
> */
>
> Only the backtick style code highlight doesn't work on multiple lines.
> Is very
> late and I need to sleep a little.
Hello:

You may find hilinks.vim helpful when working with syntax files.

http://www.drchip.org/astronaut/vim/index.html#HILINKS

This plugin provides a syntax stack trace and a highlighting stack trace
as you move your cursor about.
As an example:

SynStack: cBlock->cCppString HltTrace:
cCppString->cString->String fg<yellow> bg<navyblue>

which I got with after using :HLT! to turn hilinks' cursor tracking on
in a c file with the cursor over some code (a string, actually). This
message showed up on the messages area at the bottom of my vim window
(and it changes as the cursor moves over syntax).

Regards,
Chip Campbell




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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment