Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

XML Snippet Conditional on Root Element #498

Closed hughesjs closed 4 years ago

hughesjs commented 4 years ago

A program that I use takes input in a customised XML format. Documents have this format (I've changed the names for confidentiality reasons):

<?xml...?>
<ProprietaryRootNode>
    <CommandName att1="" att2="" />
    <CommandName2 att1="" att2=""/>
    <!--...-->
</ProprietaryRoodNode>

I've successfully made a snippet for CommandName in xml.snip.

However, I don't really want these snippets popping up in normal xml documents, I only want them to show up when ProprietaryRootNode is there. Is there any way to perform this conditional check?

Shougo commented 4 years ago

Sorry. neosnippet cannot support it. regexp feature exists, but it only check current line pattern.