Thursday, February 21, 2013

Re: conceal HTML tag attributes

On Feb 21, 7:03 pm, AK <andrei....@gmail.com> wrote:
> Hi, I would like to accomplish the following:
>
> <tag attr1='val' attr2='val'> </tag>
>
> concealed:
>
> <tag> </tag>
>
> I've mucked around with html.vim syntax file but I can't get anything to
> work, not even some very simplified example:
>
> syn match cTag +[a-z]\++ contained conceal containedin=concTag
> syn region concTag start=+zz+ end=+zz+ contains=cTag
>
> when I have this text: zz  abc  zz I thought abc would be concealed,
> but it's not. Instead, insides of html tags are concealed, which
> makes no sense at all. Please help!
>
>   - rainy


I found out what the issue was: I had my pattern on the first line of
the html file, which prevented it from working. When I moved to
the second line, it's now good.

The syn match I'm using is:
syn region htmlTag start=+<[^/]+ end=+>+
contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,doConceal

syn match doConceal + [^>]*+ conceal contained

- rainy

--
--
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/groups/opt_out.

No comments: